Everything was fine in my DBase until I added one line of code:
Me.[jobnumber] = jobnumbervariab le
This assigns the text variable jobnumbervariab le to my Table's jobnumber text field. Now the dabase won't save the data after this field is updated!
Here's the whole code for this sub:
If Left(jobnumberv ariable, 3) = "ESC" Then
me.[jobnumber] = jobnumbervariab le
DoCmd.DoMenuIte m acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
end if
end Sub
Now I get error number 2501 and a message that my doCmd command could not be done. It errors on the DoCmd line.
I checked the variable and it contains perfect data. I checked the table and the field [jobnumber] is ok too.
All I want this sub to do is to save the record, but add in the new jobnumber from the variable "jobnumbervaria ble" before saving the data, as long as this variable contains valid data as checked by the IF statement.
Does anyone know what is wrong here?
Peter
Me.[jobnumber] = jobnumbervariab le
This assigns the text variable jobnumbervariab le to my Table's jobnumber text field. Now the dabase won't save the data after this field is updated!
Here's the whole code for this sub:
If Left(jobnumberv ariable, 3) = "ESC" Then
me.[jobnumber] = jobnumbervariab le
DoCmd.DoMenuIte m acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
end if
end Sub
Now I get error number 2501 and a message that my doCmd command could not be done. It errors on the DoCmd line.
I checked the variable and it contains perfect data. I checked the table and the field [jobnumber] is ok too.
All I want this sub to do is to save the record, but add in the new jobnumber from the variable "jobnumbervaria ble" before saving the data, as long as this variable contains valid data as checked by the IF statement.
Does anyone know what is wrong here?
Peter
Comment