Disable text box after initial entry...

chhines

Registered User.
Local time
Today, 13:18
Joined
Oct 29, 2009
Messages
14
I've tried several ways to get it done but I keep ending up with errors.

I've added to the DATEREVIEWASSIGNED After_update procedure and I also have it in the property for the default value.

I realize at this point I probably shoudn't have it in both places, but I was just basically testing to see what happens in all instances.

I want the DATEREVIEWASSIGNED to be populated with today's date to start, but the initial entry user should be able to change it.

Don't pay any attention to the background formatting, I was testing what different controls do there.

I'm getting the date of 12/31/1899 in the date field now, which from what i've researched is equivalent of 0 in Access.

I can get the two date fields to greyout(disable) once you move to the next record, but it still allows you to change the date in the next record, which you shouldn't be able to do.

I'm attaching an up to date copy of the database so you can see exactly what happens when you open the Input Facility task reviewer form. Thanks.
Can someone please take a look at my sample I've uploaded and tell me how to fix this problem with my DATEREVIEWASSIGNED and DATEREVIEWDUE?
 

Attachments

Hi,

First of all, please consider myself as a newbie.. I'm sure you will get
far better sugestions from other users.

Nevertheless, after a quick look to your DB, I would
suggest to change the Validation Rule of DATEREVIEWASSIGNED. Something like ">=Date()-30 And <=#31-12-2035#"


Give it a try

DATEREVIEWASSIGNED.locked = true

when you "grey" your fields


Hope it helps


Antonio
 
hi guys, Ive got a script that disables a text box if certain selection is made on a drop down. here is the code:

Private Sub DeviceType_AfterUpdate()
If Me.DeviceType = "Router" Then
Me.DeviceOS.Enabled = False
Else
If Me.DeviceType = "Printer" Then
Me.DeviceOS.Enabled = False
Else
If Me.DeviceType = "Scanner" Then
Me.DeviceOS.Enabled = False
Else
Me.DeviceOS.Enabled = True
End If
End If
End If
End Sub

however I want it to disable multiple boxes...how do i do that? (I hope this helps someone as well?)
 
How about a select case type deal along with other code or a function that finds either all text boxes, or you can tag your controls and find all the controls with a certain tag label (You can google how to do this):

Code:
 Dim DeviceType As String
 
'You may not need to doe this this way
'You might be able to do the select case as
'Select Case Me.DeviceType
'I don't have time to test it right now
'DeviceType = Me.DeviceType
 
Select Case DeviceType
 
Case "Router"
    'Your code here
Case "Printer"
     'Your code here
Case "Scanner"
     'Your code here
Case Else
     'Your code here
End Select

EDIT: Here is a link to a thread giving the solution I am suggesting. Here is another solution I found
 
Last edited:
im not sure what code i put under each case. The creation of cases and such is completely new to me. I dont know anything about "As Bolean" or what ever, complete noob, please excuse me.

looks like i am a quick learner! see attached people...incase you want this solution.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom