Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Form2"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Form2"
stLinkCriteria = "[mainSSN]=" & "'" & Me![SSn] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Private Sub openForm2_Click()
Dim stDocName As String
Dim newstrSSN, newmainSSN As String
Dim strSSN, strFname, strLName, strmainSSN As String
stDocName = "Form2"
'Store the calling form's (form1) SSN, FName, and
'LName to add to new record in form2, if needed.
strSSN = Me!SSn
strFname = Me!FName
strLName = Me!LName
'Open form2, goto the matching SSN field, and set the
'focus to it. NOTE: the strSSn at the end of the
'following line is the OpenArgs property. It is the
'SSN I wish to locate in Form2, and is by the
'DoCmd.FindRecord
DoCmd.OpenForm stDocName, , , , acFormEdit, , strSSN
Forms!form2!mainSSN.SetFocus
'Assign form2's mainSSN to a temp variable
strmainSSN = Forms!form2!mainSSN
'Find the first record in table2 (form2) that matches
'the SSN
DoCmd.FindRecord strSSN, , True, , True, , True
'If the SSN's do not match (not found in table2, then
'this must be a new record so add a new record and
'populate the listed fields of Form2
If strmainSSN <> strSSN Then
DoCmd.GoToRecord , , acNewRec
Forms!form2!FName = strFname
Forms!form2!LName = strLName
Forms!form2!mainSSN = strSSN
End If
End Sub