G
Guest
Hi, I have 2 forms. Form A and Form B. They both have 2 fields called
"Company" and "Registration Number". I know it's possible to automatically
have the one of the fields filled up in Form B when details have been input
in Form A. What I want to know whether it's possible to have more than 1
field being filled up automatically?.
Below are the codes for Form A
Private Sub Person_Details_Click()
Dim strOpenArgs As String
Dim strCriteria As String
Dim strOpenArgss As String
Dim strCriterias As String
Dim strFormName As String
On Error GoTo Proc_Error
strFormName = "Person Details"
strCriteria = "[Company] = '" & Me![Company] & "'"
strOpenArgs = Me![Company]
DoCmd.OpenForm strFormName, WhereCondition:=strCriteria, OpenArgs:=strOpenArgs
Proc_Exit: Exit Sub
Proc_Error:
MsgBox "Error " & Err.Number & " in Person_Details_Click:" _
& vbCrLf & Err.Description
Resume Proc_Exit
End Sub
-------------------------------------------------------------------------
Below are the codes for Form B
Private Sub Form_Open(Cancel As Integer)
Const Quote As String = """"
If Me.OpenArgs & "" <> "" Then
Me![Company].DefaultValue = Quote & Me.OpenArgs & Quote
End If
End Sub
"Company" and "Registration Number". I know it's possible to automatically
have the one of the fields filled up in Form B when details have been input
in Form A. What I want to know whether it's possible to have more than 1
field being filled up automatically?.
Below are the codes for Form A
Private Sub Person_Details_Click()
Dim strOpenArgs As String
Dim strCriteria As String
Dim strOpenArgss As String
Dim strCriterias As String
Dim strFormName As String
On Error GoTo Proc_Error
strFormName = "Person Details"
strCriteria = "[Company] = '" & Me![Company] & "'"
strOpenArgs = Me![Company]
DoCmd.OpenForm strFormName, WhereCondition:=strCriteria, OpenArgs:=strOpenArgs
Proc_Exit: Exit Sub
Proc_Error:
MsgBox "Error " & Err.Number & " in Person_Details_Click:" _
& vbCrLf & Err.Description
Resume Proc_Exit
End Sub
-------------------------------------------------------------------------
Below are the codes for Form B
Private Sub Form_Open(Cancel As Integer)
Const Quote As String = """"
If Me.OpenArgs & "" <> "" Then
Me![Company].DefaultValue = Quote & Me.OpenArgs & Quote
End If
End Sub