L
LadyAmethyst
I have a Access 97 database with 2 forms. The first form
is frmEstimate the second form is frmDeposit. There are
2 tables tblEstimate and tblDeposit and JobID is the key
on both tables.
The frmEstimate has a Command Button called "Create/Find
Deposit".
Now the following code works fine if the record is
already in the tblDeposit but if there is no record I
want it to put 3 values in the new record from the
frmEstimate. I want it to pass the JobID, TotalCost,
and the JobDivision. Now even when I enter these values
myself and fill in the other fields, nothing gets saved
to the table. What am I missing?
Private Sub CreateFindDeposit_Click()
On Error GoTo Err_CreateFindDeposit_Click
Dim strDocName As String
Dim strLinkCriteria As String
strDocName = "frmDeposit"
strLinkCriteria = "[JobID]=" & "'" & Me![JobID] & "'"
DoCmd.OpenForm strDocName, , , strLinkCriteria
Exit_CreateFindDeposit_Click:
Exit Sub
Err_CreateFindDeposit_Click:
MsgBox Err.Description
Resume Exit_CreateFindDeposit_Click
End Sub
Now frmDeposit has a filter [JobID]='040904-01'
but nothing shows up in the JobID form field.
I have also tried the following OnOpen Expression
=[JobID]=[Forms]![frmEstimate]![JobID]
I also don't know how to pass it the other 2 fields
that it needs. Can anyone tell me what I'm doing
wrong?
Thanks
is frmEstimate the second form is frmDeposit. There are
2 tables tblEstimate and tblDeposit and JobID is the key
on both tables.
The frmEstimate has a Command Button called "Create/Find
Deposit".
Now the following code works fine if the record is
already in the tblDeposit but if there is no record I
want it to put 3 values in the new record from the
frmEstimate. I want it to pass the JobID, TotalCost,
and the JobDivision. Now even when I enter these values
myself and fill in the other fields, nothing gets saved
to the table. What am I missing?
Private Sub CreateFindDeposit_Click()
On Error GoTo Err_CreateFindDeposit_Click
Dim strDocName As String
Dim strLinkCriteria As String
strDocName = "frmDeposit"
strLinkCriteria = "[JobID]=" & "'" & Me![JobID] & "'"
DoCmd.OpenForm strDocName, , , strLinkCriteria
Exit_CreateFindDeposit_Click:
Exit Sub
Err_CreateFindDeposit_Click:
MsgBox Err.Description
Resume Exit_CreateFindDeposit_Click
End Sub
Now frmDeposit has a filter [JobID]='040904-01'
but nothing shows up in the JobID form field.
I have also tried the following OnOpen Expression
=[JobID]=[Forms]![frmEstimate]![JobID]
I also don't know how to pass it the other 2 fields
that it needs. Can anyone tell me what I'm doing
wrong?
Thanks