Form control source

G

Guest

I have a form that is based on a query (Qry_User_XFDP) which filters records
for the specific user.

SELECT Tbl_XFDP.ID, Tbl_XFDP.Firms_Number, Tbl_XFDP.VCP_Priority,
Tbl_XFDP.Proj_Name, Tbl_XFDP.Business_Owner,
Tbl_XFDP.Current_Stage_in_Process, Tbl_XFDP.Load_Status, Tbl_XFDP.Planned_Load
FROM Tbl_User INNER JOIN Tbl_XFDP ON Tbl_User.EmpName =
Tbl_XFDP.VCP_IT_Liaison
WHERE (((Tbl_User.EmpNum)=595930));

I need to cahnge the WHERE clause in my query to a variable (MyEmplNum)
rather than a hard coded number and I need your help in constructing a form
soure that is dynamic.

Thanks
 
S

SusanV

Hi Rafi,

Remove the WHERE clause from the data source query and instead put it in the
VBA that opens the form:

Dim strEmpNum as String
strEmpNum = "Something" 'wherever this comes from
DoCmd.OpenForm "YourForm",,,"Tbl_User.EmpNum = " & strEmpNum
 
G

Guest

Try this for your where
WHERE ((([Tbl_User].[EmpNum])=[Enter your Employee Number]));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top