D
dohernan
When a person chooses “Verification†from a dropdown list, either the current
record has a SSN that is already in the Personnel table, which opens the
“VerifLMini†form, or the SSN is not found and a “VerifLetterInfo†form opens
up, ready to be filled with an address and whatever comments, which is then
saved to an Address Table.
When the VerifLmini form pops up it has the address from the address table
already filled in, and the SSN and name from the Personnel table filled in as
well. The person can look at the info and “create my report/letter†or they
can decide they need to edit/add more info.
When they decide to edit/add more is when I have issues. I have a button to
open the VerifLetterInfo form from the mini form, but I’m not sure how to
pass the current record information to it, so the person won’t have to type
everything in.
The Address table has an Auto# Field called AddressRecord
The Personnel table has an Auto# Field called Record
The current OpenArgs to the VerifLetterInfo form-
Private Sub Form_Load()
If Not IsNull(Me.OpenArgs) Then
Me.SSN = Me.OpenArgs
End If
End Sub
++++++++++++++++++++++++++++++++++
Private Sub FormType_AfterUpdate()
If Me.[FormType] = "Verification" Then
If Me.Dirty Then Me.Dirty = False
If IsNull(DLookup("SSN", "VerificationLetterInformation", "SSN = '" &
Me.SSN & "'")) Then
' The SSN does not exist in the second table.
' Open form VerifLetterInfo so that they can add the necessary information.
DoCmd.OpenForm "VerifLetterInfo", DataMode:=acFormAdd, _
WindowMode:=acDialog, OpenArgs:=Me.SSN
Else
' The SSN exists in the second table.
' Open Form VerifLMini in case they want to change the information.
DoCmd.OpenForm "VerifLMini", WindowMode:=acDialog, _
WhereCondition:="SSN = '" & Me.SSN & "'"
End If
End If
End Sub
+++++++++++++++++++++++++++++++++
What isn’t working in the VerifMini form-
Private Sub Add_Edit_Letter_Info_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "VerifLetterInfo"
DoCmd.OpenForm stDocName, , , stLinkCriteria, _
"[AddressRecord] = " & Me.AddressRecord
End Sub
Also tried-
DoCmd.OpenForm "VerifLetterInfo", WindowMode:=acDialog, _
WhereCondition:="SSN = '" & Me.SSN & "'"
Thanks.
record has a SSN that is already in the Personnel table, which opens the
“VerifLMini†form, or the SSN is not found and a “VerifLetterInfo†form opens
up, ready to be filled with an address and whatever comments, which is then
saved to an Address Table.
When the VerifLmini form pops up it has the address from the address table
already filled in, and the SSN and name from the Personnel table filled in as
well. The person can look at the info and “create my report/letter†or they
can decide they need to edit/add more info.
When they decide to edit/add more is when I have issues. I have a button to
open the VerifLetterInfo form from the mini form, but I’m not sure how to
pass the current record information to it, so the person won’t have to type
everything in.
The Address table has an Auto# Field called AddressRecord
The Personnel table has an Auto# Field called Record
The current OpenArgs to the VerifLetterInfo form-
Private Sub Form_Load()
If Not IsNull(Me.OpenArgs) Then
Me.SSN = Me.OpenArgs
End If
End Sub
++++++++++++++++++++++++++++++++++
Private Sub FormType_AfterUpdate()
If Me.[FormType] = "Verification" Then
If Me.Dirty Then Me.Dirty = False
If IsNull(DLookup("SSN", "VerificationLetterInformation", "SSN = '" &
Me.SSN & "'")) Then
' The SSN does not exist in the second table.
' Open form VerifLetterInfo so that they can add the necessary information.
DoCmd.OpenForm "VerifLetterInfo", DataMode:=acFormAdd, _
WindowMode:=acDialog, OpenArgs:=Me.SSN
Else
' The SSN exists in the second table.
' Open Form VerifLMini in case they want to change the information.
DoCmd.OpenForm "VerifLMini", WindowMode:=acDialog, _
WhereCondition:="SSN = '" & Me.SSN & "'"
End If
End If
End Sub
+++++++++++++++++++++++++++++++++
What isn’t working in the VerifMini form-
Private Sub Add_Edit_Letter_Info_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "VerifLetterInfo"
DoCmd.OpenForm stDocName, , , stLinkCriteria, _
"[AddressRecord] = " & Me.AddressRecord
End Sub
Also tried-
DoCmd.OpenForm "VerifLetterInfo", WindowMode:=acDialog, _
WhereCondition:="SSN = '" & Me.SSN & "'"
Thanks.