I have a field that i need to have disabled when the user enters info into it. It accepts a number (which is a required field) that is used to determine how many rows to insert into a table and then display on the next form that opens. After they are created, when the button on the first form is clicked, instead of creating new records, it retrieves the ones created the first time. Therefore, changing this number on the first form will have no effect on the number of rows created in the table. I want to gray out the text field *only if/after* the user has entered that number. For some reason, when I tried
Private Sub txtLayers_AfterUpdate()
' If txtLayers > 0 Then
' txtLayers.Enabled = False
' End If
it grays out this field on *all* records... even the ones that are either blank or have 0's. (some were able to be created without entering this field because I didn't make it required until later)
Right now, I have this:
Private Sub txtLayers_BeforeUpdate(Cancel As Integer)
If txtLayers > 0 Then
MsgBox "Number of Layers has been previously created and cannot be changed"
I dont like that the user is not alerted until after they have entered the new number. I would rather them be able to see that it is not editable once the number is in there. Any suggestions as to how to do this and/or why the first code above is not working?
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment: Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010 VB based on my own environment: vb6 sp5 ASP based on my own environment: 5.6 VB-NET based on my own environment started 2007 SQL-2005 based on my own environment started 2008 MYLE YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.