R
RV55
I'm trying to increment the default value of a text box in a subform.
Although everything seems right I keep getting #name?.
This is what I did;
1. Created 2 linked tables- AssetDB and AssetGroupsDB.
Every record in AssetDB belongs to 1 of the groups set up in AssetGroupsDB.
2. Created a form "Asset Group Management" that shows the AssetGroupsDB
details on the top half and the matching AssetDB records on the bottom half
in a datasheet format.
3. Creted the following code the the "On Enter" event proceedure for the
subform.
Forms![Asset Group Management]![AssetsDB
Subform].Form![AssetID].DefaultValue = "V" & Format((Right(DMax("AssetID",
"AssetsDB"), 5) + 1), "00000")
This should assign a default of a 6 character string starting with "V" and
ending with an incremented 5 digit number.
When I change focus to the subform the default value changes to #name?.
Things I've tried;
Putting the right side of the equation in a msgbox- it show "V00003" so the
right side is ok.
Tried to assign just "V00003"- I still get #name?.
Assigning a number- it works so the left side of the equation is ok.
Seems like it just wont take stings.
Any ideas?
Although everything seems right I keep getting #name?.
This is what I did;
1. Created 2 linked tables- AssetDB and AssetGroupsDB.
Every record in AssetDB belongs to 1 of the groups set up in AssetGroupsDB.
2. Created a form "Asset Group Management" that shows the AssetGroupsDB
details on the top half and the matching AssetDB records on the bottom half
in a datasheet format.
3. Creted the following code the the "On Enter" event proceedure for the
subform.
Forms![Asset Group Management]![AssetsDB
Subform].Form![AssetID].DefaultValue = "V" & Format((Right(DMax("AssetID",
"AssetsDB"), 5) + 1), "00000")
This should assign a default of a 6 character string starting with "V" and
ending with an incremented 5 digit number.
When I change focus to the subform the default value changes to #name?.
Things I've tried;
Putting the right side of the equation in a msgbox- it show "V00003" so the
right side is ok.
Tried to assign just "V00003"- I still get #name?.
Assigning a number- it works so the left side of the equation is ok.
Seems like it just wont take stings.
Any ideas?