M
Mike Revis
Hi Group,
Winxppro, Access2000
I'm having a problem figuring out how to write my where clause.
I have a query that returns job numbers based on entering all or part of a
sales order number.
The query is run from a command button on my "menu form". frmMainMenu.
SELECT DISTINCT tblPackageData.JobNumber
FROM tblPackageData LEFT JOIN tblRefNo ON tblPackageData.PackageID =
tblRefNo.PackageID
WHERE (((tblRefNo.SalesOrder) Like "*" & [Enter Sales Order Number ] &
"*"));
That part seems to be working ok. When I enter all or part of a sales order
number I get a list of all the jobs that meet that criteria.
Now what I would like to accomplish is to open the job form (frmJobData) to
show all the records that match the query result.
So far I have this.
......cmdFindJobBySalesOrder_Click()
Dim stDocName As String
Dim stfrmName As String
Dim stLinkCriteria As String
stDocName = "qryFindJobBySalesOrder"
stfrmName = "frmJobData"
DoCmd.OpenQuery stDocName
DoCmd.OpenForm stfrmName, , , stLinkCriteria
Or perhaps there is a different way to accomplish this.
As always any thoughts, comments or suggestions are welcome.
Best regards
Mike
Winxppro, Access2000
I'm having a problem figuring out how to write my where clause.
I have a query that returns job numbers based on entering all or part of a
sales order number.
The query is run from a command button on my "menu form". frmMainMenu.
SELECT DISTINCT tblPackageData.JobNumber
FROM tblPackageData LEFT JOIN tblRefNo ON tblPackageData.PackageID =
tblRefNo.PackageID
WHERE (((tblRefNo.SalesOrder) Like "*" & [Enter Sales Order Number ] &
"*"));
That part seems to be working ok. When I enter all or part of a sales order
number I get a list of all the jobs that meet that criteria.
Now what I would like to accomplish is to open the job form (frmJobData) to
show all the records that match the query result.
So far I have this.
......cmdFindJobBySalesOrder_Click()
Dim stDocName As String
Dim stfrmName As String
Dim stLinkCriteria As String
stDocName = "qryFindJobBySalesOrder"
stfrmName = "frmJobData"
this is where I'm stuck stLinkCriteria = "[JobNumber]='" &
JobNumber is a text data type
DoCmd.OpenQuery stDocName
DoCmd.OpenForm stfrmName, , , stLinkCriteria
Or perhaps there is a different way to accomplish this.
As always any thoughts, comments or suggestions are welcome.
Best regards
Mike