D
deb
Access 2003
I have a form called fPMAddEdit(PK PMID and fields PMLName, PMFName, Title.
This form is to enter new Project Managers.
There is a second form called fEmailAddEdit(fields RecipientLastName,
RecipientFirstName and RecipientTitle. This form is to enter email addresses.
Most Project Managers will have an email associated.
However there may be other email addresses for people that are not in the
fPMAddEdit form.
In the form fPMAddEdit I have a btnEmail that opens the fEmailAddEdit form.
If there is a record associated with PMID in fEmailAddEdit then display
data. - PMLName=RecipientLastName, PMFName=RecipientFirstName ,
Title=RecipientTitle. (In case there are edits to the 3 fields)
If there is not a record already associated with the PMID then fill in the 3
fields...PMLName=RecipientLastName, PMFName=RecipientFirstName ,
Title=RecipientTitle.
The below code works but it only send over one field(fPMAddEdit.PMLName) to
fEmailAddEdit.RecipientLastName).
How can I edit the code to send all 3 fields?
Private Sub btnEmail_Click()
On Error GoTo Err_btnEmail_Click
If Me.Dirty = True Then
Me.Dirty = False
End If
Dim strOpenArgs As String
Dim strCriteria As String
Dim strFormName As String
On Error GoTo Proc_Error
strFormName = "fEmailAddEdit"
strCriteria = "[PMID] = " & Me![PMID]
strOpenArgs = Me![PMLName]
DoCmd.OpenForm strFormName, WhereCondition:=strCriteria, OpenArgs:=strOpenArgs
Proc_Exit: Exit Sub
Proc_Error:
MsgBox "Error " & Err.Number & " in btnEmail_Click:" _
& vbCrLf & Err.Description
Resume Proc_Exit
End Sub
Private Sub Form_Open(Cancel As Integer)
Const Quote As String = """"
If Me.OpenArgs & "" <> "" Then
Me![RecipientLastName].DefaultValue = Quote & Me.OpenArgs & Quote
End If
I have a form called fPMAddEdit(PK PMID and fields PMLName, PMFName, Title.
This form is to enter new Project Managers.
There is a second form called fEmailAddEdit(fields RecipientLastName,
RecipientFirstName and RecipientTitle. This form is to enter email addresses.
Most Project Managers will have an email associated.
However there may be other email addresses for people that are not in the
fPMAddEdit form.
In the form fPMAddEdit I have a btnEmail that opens the fEmailAddEdit form.
If there is a record associated with PMID in fEmailAddEdit then display
data. - PMLName=RecipientLastName, PMFName=RecipientFirstName ,
Title=RecipientTitle. (In case there are edits to the 3 fields)
If there is not a record already associated with the PMID then fill in the 3
fields...PMLName=RecipientLastName, PMFName=RecipientFirstName ,
Title=RecipientTitle.
The below code works but it only send over one field(fPMAddEdit.PMLName) to
fEmailAddEdit.RecipientLastName).
How can I edit the code to send all 3 fields?
Private Sub btnEmail_Click()
On Error GoTo Err_btnEmail_Click
If Me.Dirty = True Then
Me.Dirty = False
End If
Dim strOpenArgs As String
Dim strCriteria As String
Dim strFormName As String
On Error GoTo Proc_Error
strFormName = "fEmailAddEdit"
strCriteria = "[PMID] = " & Me![PMID]
strOpenArgs = Me![PMLName]
DoCmd.OpenForm strFormName, WhereCondition:=strCriteria, OpenArgs:=strOpenArgs
Proc_Exit: Exit Sub
Proc_Error:
MsgBox "Error " & Err.Number & " in btnEmail_Click:" _
& vbCrLf & Err.Description
Resume Proc_Exit
End Sub
Private Sub Form_Open(Cancel As Integer)
Const Quote As String = """"
If Me.OpenArgs & "" <> "" Then
Me![RecipientLastName].DefaultValue = Quote & Me.OpenArgs & Quote
End If