PDA

View Full Version : Solved: Importing Text Data - Data Type Problem



DonCard
09-21-2006, 12:48 PM
I am trying to import data with a text file. The data is delimited with semicolons and the first row contains the field names. The database contains a field with a yes/no data type. The text data for that particular field is either an "x" or is blank (null). The null is no problem and results in an unchecked box but the "x" causes a conversion error. Is there a text character that will result in a checked box?

Don

Imdabaum
09-21-2006, 02:16 PM
From what I am aware of the check is a simple 1 or 0. Or true/false option. Might want to look into the helps on check boxes to make sure but I think I saw that somewhere. The 1 or True creates the X in the checkbox.

DonCard
09-21-2006, 03:19 PM
Thanks, I thought it must be something simple: 1 checked, 0 unchecked.

Don

Imdabaum
09-22-2006, 07:54 AM
It's just a thought, let me know if it works. Otherwise I'll look for something else.

DonCard
09-22-2006, 10:45 AM
Imdabaum,
It worked just fine. A 1 results in a checked box, a 0 or null results in an unchecked box.
Thanks,
Don

Imdabaum
09-26-2006, 11:32 AM
Okay folks... This time the post is really solved.... For now. I realized that the source of the session lock on the Memo record was from the Main form. While the main form was open using the tblProperties record, I couldn't update it. So I modified my update routine to the following.

Set tDef = dbs.TableDefs("tblProperties")
'MsgBox Len(strMemo), vbInformation, "Length of Memo"
Set records = tDef.OpenRecordset(dbOpenDynaset)
records.FindFirst "ID = " & PropID
If Not records.NoMatch Then
DoCmd.Close acForm, "frmPropertiesNew", acSaveYes
records.Edit
records.Fields("Memo") = strMemo
records.Update
DoCmd.OpenForm "frmPropertiesNew", acNormal, , "ID = " & Me.PropertyID
End If


Now the record is unlocked for use by the UpdateNotes form and the record gets saved! And best of all I don't get any errors!!!!