Code for new record txtbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On the form Inventory, I have many bound text boxes for an inventory
database. I will only discuss two of them named AssetID (not the primary
key) and txtAssetIDType. AssetID and txtAssetIDType many times are null.
When I type a number in AssetID greater than 9999 I would like the
txtAssetIDType to default to the number 1, since this is the case 90% of the
time. Other txtAssetIDType can be typed in manually such as Y, E, 2, 4 etc...
I would like to put the code in the AfterUpDate event of AssetID. This has
stumped me even though I'm sure it's pretty easy. I have tried If
Me.AssetID > 9999 then Me.Tag = "1" else Me.Tag = IsNull(Me.Tag).
 
In the AfterUpdate event of AssetID:
If Me.AssetID > 9999 Then
Me.txtAssetIDType = 1
End If
 
Back
Top