Hi,
I have a form which contains a couple of textboxs, buttons etc. Quite simply, I am trying to assign a value to the textbox when the form opens but I am getting the following error message:
The code opening the form is:
So looks fairly simple .
I have checked Data Entry, Allow Additions, Allow Deletions etc these are all set to yes - looking around these seem to be responsible for some of these types of errors alas not on this occasion...
Can anyone shed any light on what is causing this?
Thanks
I have a form which contains a couple of textboxs, buttons etc. Quite simply, I am trying to assign a value to the textbox when the form opens but I am getting the following error message:
The code driving this is "quite" simple for what I'm asking it to do:run-time error 2558:
You can't assign a value to this object
Code:
Private Sub Form_Open(Cancel As Integer)
Dim strArgs() As String
NavigationButtons = False
RecordSelectors = False
If (Not IsNull(OpenArgs)) Then
strArgs = Split(OpenArgs, ",")
Select Case strArgs(0)
Case "New"
txtDate.Locked = False
txtDate.Value = Format(Now, "dd mmm yyyy")
txtCreatedBy.Locked = False
txtCreatedBy.Value = NTDomainUserNameFormatted
End Select
End If
End Sub
Code:
DoCmd.OpenForm "frmNewPartNumber", acNormal, , "PartNo='" & vCreateNextNumber.NewNumber & "'", , , "New"
I have checked Data Entry, Allow Additions, Allow Deletions etc these are all set to yes - looking around these seem to be responsible for some of these types of errors alas not on this occasion...
Can anyone shed any light on what is causing this?
Thanks