G
Guest
Hi, i want to open a form from an already open form, storing a field in a
variable before the new form opens, i then want to use this stored value in
the newly opened form to select a box and set its visible property to false.
I posted a question on this last week and was given code which was verty
helpful. Except now when i use this code in the new context i recieve an
error message. "run-time error '2465' microsoft access can't find the field
'(variable contents)' referred to in your expression."
the code i am using is as follows.
Private Sub cmdS_Click()
Dim SW As String
SW = SC '(where SC is the field value from the original form)
DoCmd.OpenForm "frmSS", acNormal
If Me(SW).Visible = True Then
Me(SW).Visible = False
ElseIf Me(SW).Visible = False Then
Me(SW).Visible = True
Else
End If
End Sub
variable before the new form opens, i then want to use this stored value in
the newly opened form to select a box and set its visible property to false.
I posted a question on this last week and was given code which was verty
helpful. Except now when i use this code in the new context i recieve an
error message. "run-time error '2465' microsoft access can't find the field
'(variable contents)' referred to in your expression."
the code i am using is as follows.
Private Sub cmdS_Click()
Dim SW As String
SW = SC '(where SC is the field value from the original form)
DoCmd.OpenForm "frmSS", acNormal
If Me(SW).Visible = True Then
Me(SW).Visible = False
ElseIf Me(SW).Visible = False Then
Me(SW).Visible = True
Else
End If
End Sub