438 Error

G

Guest

I've got a form that open in Edit mode. The CustID field is locked out
(Enabled = No and Locked = Yes) in order to prevent people from changing the
key field. When the user clicks Add they must manually specify a unique
key field, so the CustID must be enabled and unlocked. That is the purpose
of this code, but I'm getting a 438 object doesn't support this property or
method error. What am I doing wrong?

DoCmd.GoToRecord , , acNewRec
With Me!CustID
.Enabled = True
.Locked = False
.TabStop = True
.SetFocus = True
End With
 
G

Guest

That worked - thanks. Can I associate this code with the Access supplied Add
navigation button? I know I can create buttons to duplicate the Navigation
buttons, but I really don't want to do that - I only need to interact with
the Add button.
 
G

Guest

Move the code to the form's Current event and check to see if it is a new
record:
If Me.NewRecord Then
With Me!CustID
.Enabled = True
.Locked = False
.TabStop = True
.SetFocus
End With
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top