L
LadyAmethyst
Help Please?
I have a problem in Access 97. I have 1 form that is
supposed to display data from 2 records (tblCustomer &
tblJobSite). The problem is that on some records the
RecordSource ( an SQL query ) works fine and sometimes
it dosen't work at all and gives me a form with no data
in the form fields. (Yes there is data in the tables.)
There is 1 table that stores the Customer information.
There is 1 table that stores the Job Site information
(this allows for 1 Customer but many different Job Sites).
There is a print action that use information from both
the Customer and Job Site information and the current
form such as frmEstimate. There is a frmEstimate,
a frmRevisedEstimate, frmDeposit, frmWorkOrder etc.
All of these eventually lead to printing a document.
All of these forms have a command button that bring up
the screen with the Customer and Job Site information.
The frmJobSiteInformation has a command button that
allows the user to print the document needed.
If I open frmJobSiteInformation by itself (not through
the frmEstimate, then all the records are displayed.
Data Entry on this form (frmJobSiteInformation) is set
to "No" because this is not the place where data entry
or corrections need to be made. I have both a
frmCustomer goes to tblCustomer and frmJobSite goes to
tblJobSite this is the place to enter the initial
information. There is a CustomerID field in both
tblCustomer and tblJobSite. There is the JobID field in
both tblJobSite and tblEstimate et.al. Both JobID and
CustomerID are text fields.
The form is frmJobSiteInformation, the SQL query was
actually built by the forms Wizard.
SELECT DISTINCTROW tblJobSite.CustomerID, tblJobSite.JobID,
tblJobSite.ContactName, tblJobSite.JobSiteAddress,
tblJobSite.JobSiteCity, tblJobSite.JobSiteState,
tblJobSite.JobSitePhone, tblCustomer.CompanyName,
tblCustomer.CustContactName, tblCustomer.CustomerAddress,
tblCustomer.CustomerCity, tblCustomer.CustomerState,
tblCustomer.CustomerZipCode, tblCustomer.CustomerPhone
FROM tblCustomer INNER JOIN tblJobSite ON
tblCustomer.CustomerID = tblJobSite.CustomerID;
Now there is a command button in the frmEstimate
(cmdJobSiteInformation) that opens the frmJobSiteInformation
matching the field JobID in both the frmEstimate and
the frmJobSiteInformation.
Private Sub cmdJobSiteInformation_Click()
On Error GoTo Err_cmdJobSiteInformation_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmJobSiteInformation"
stLinkCriteria = "[JobID]=" & "'" & Me![txtJobID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdJobSiteInformation_Click:
Exit Sub
Err_cmdJobSiteInformation_Click:
MsgBox Err.Description
Resume Exit_cmdJobSiteInformation_Click
End Sub
The frmJobSiteInformation is displayed to the screen
and it has a command button (cmdPrintEstimate)
after the Estimate is printed the user returns to the
frmEstimate and can exit back to the Switchboard
or enter another estimate.
I can't figure it out. Is there a better way that I
should be using? Please help, I'm at a dead end.
Thanks,
LadyAmethyst
I have a problem in Access 97. I have 1 form that is
supposed to display data from 2 records (tblCustomer &
tblJobSite). The problem is that on some records the
RecordSource ( an SQL query ) works fine and sometimes
it dosen't work at all and gives me a form with no data
in the form fields. (Yes there is data in the tables.)
There is 1 table that stores the Customer information.
There is 1 table that stores the Job Site information
(this allows for 1 Customer but many different Job Sites).
There is a print action that use information from both
the Customer and Job Site information and the current
form such as frmEstimate. There is a frmEstimate,
a frmRevisedEstimate, frmDeposit, frmWorkOrder etc.
All of these eventually lead to printing a document.
All of these forms have a command button that bring up
the screen with the Customer and Job Site information.
The frmJobSiteInformation has a command button that
allows the user to print the document needed.
If I open frmJobSiteInformation by itself (not through
the frmEstimate, then all the records are displayed.
Data Entry on this form (frmJobSiteInformation) is set
to "No" because this is not the place where data entry
or corrections need to be made. I have both a
frmCustomer goes to tblCustomer and frmJobSite goes to
tblJobSite this is the place to enter the initial
information. There is a CustomerID field in both
tblCustomer and tblJobSite. There is the JobID field in
both tblJobSite and tblEstimate et.al. Both JobID and
CustomerID are text fields.
The form is frmJobSiteInformation, the SQL query was
actually built by the forms Wizard.
SELECT DISTINCTROW tblJobSite.CustomerID, tblJobSite.JobID,
tblJobSite.ContactName, tblJobSite.JobSiteAddress,
tblJobSite.JobSiteCity, tblJobSite.JobSiteState,
tblJobSite.JobSitePhone, tblCustomer.CompanyName,
tblCustomer.CustContactName, tblCustomer.CustomerAddress,
tblCustomer.CustomerCity, tblCustomer.CustomerState,
tblCustomer.CustomerZipCode, tblCustomer.CustomerPhone
FROM tblCustomer INNER JOIN tblJobSite ON
tblCustomer.CustomerID = tblJobSite.CustomerID;
Now there is a command button in the frmEstimate
(cmdJobSiteInformation) that opens the frmJobSiteInformation
matching the field JobID in both the frmEstimate and
the frmJobSiteInformation.
Private Sub cmdJobSiteInformation_Click()
On Error GoTo Err_cmdJobSiteInformation_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmJobSiteInformation"
stLinkCriteria = "[JobID]=" & "'" & Me![txtJobID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdJobSiteInformation_Click:
Exit Sub
Err_cmdJobSiteInformation_Click:
MsgBox Err.Description
Resume Exit_cmdJobSiteInformation_Click
End Sub
The frmJobSiteInformation is displayed to the screen
and it has a command button (cmdPrintEstimate)
after the Estimate is printed the user returns to the
frmEstimate and can exit back to the Switchboard
or enter another estimate.
I can't figure it out. Is there a better way that I
should be using? Please help, I'm at a dead end.
Thanks,
LadyAmethyst