Form value not being passed

  • Thread starter Thread starter Tara
  • Start date Start date
T

Tara

I have a form with an option group. If the option group value = 2, then I
want another form to open up so that the user can leave notes. I want the
forms to be related via a common ScreenID number. At this point, the form
opens, but the ScreenID number isn't being passed from the first screen.
Obviously I'm doing something wrong. Here's the code I have currently:

Private Sub frameAccept_AfterUpdate()

Dim strWhere As String
If frameAccept.Value = 2 Then

If Not IsNull(Me.ScreenID) Then
strWhere = "[ScreenID] = " & Me.ScreenID

DoCmd.OpenForm "frmRequestNotes", , , strWhere, acFormEdit

End If

End If
End Sub
 
Assuming what you are seeing is a blank record. You need to have
frmRequestNotes read the value of ScreenID from the other form. If the
frmRequestNotes is always opened by lets call it "Form1" then you can simply
set the DefaultValue property of the Screen ID. If frmRequestNotes can be
opened by itself, you'll need to check for the existence of Form1 and use
code to set the DefaultValue property.
 
Back
Top