Form value not being passed

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
 
A

Arvin Meyer [MVP]

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.
 

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