show the same id when opening a form

  • Thread starter Thread starter leaf
  • Start date Start date
L

leaf

Hello,

I have a form called FormAge55 which is linked to
FormPhoneScreen. After I open FormPhoneScreen, there is a
button to open FormAge55. I want the same ID to show when
FormAge55 opens up when FormPhoneScreen is open. I wrote
the following code but it did not work. Could anyone tell
me what could be the problem?

Thanks,

Yeying


Private Sub openage55_Click()
[Form_FormPhoneScreen]!ID.Value = [Form_FormAge55]!ID.Value
End Sub
 
See "OpenForm" in Access HELP.

Example: (Opening a form based on selection from combo box)
'
Private Sub cmdMembers_Click()
On Error GoTo Err_cmdMembers_Click
'
If Not IsNull(Me![cboName]) Then
DoCmd.Hourglass True
DoCmd.Echo False, "Please wait..."
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmMEMBERS_EDIT"
stLinkCriteria = "[MemID]=" & Me![cboName]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Hourglass False
DoCmd.Echo True
DoCmd.Maximize
Else
Dim strMsg As String
Dim strTitle As String
strMsg = "No name selected. Please try again."
strTitle = "No Selection Made"
MsgBox strMsg, vbOKOnly + vbInformation, strTitle
End If
'
'
'
Exit_cmdMembers_Click:
DoCmd.Hourglass False
DoCmd.Echo True
Exit Sub
'
Err_cmdMembers_Click:
DoCmd.Hourglass False
DoCmd.Echo True
MsgBox Err.Description
Resume Exit_cmdMembers_Click
'
End Sub
 
Back
Top