Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

We need to locate files using data from two input forms 1

Status
Not open for further replies.

Sherman6789

Programmer
Nov 12, 2002
127
US
We have a database that consists of the following:

Table of salespersons: tblSP
Table of Date Ranges: tblDR

Report1 Item Sales information: rpt1
Report2 Customer Sales Information: rpt2

Form1 SignOn form with ID and Password
Form2 Basic Info

We would like the signOn form to first appear giving the salesperson (tblSP) the opportunity to sign on by selecting his or her name from a pull-down. The salesperson’s name is captured and all files not associated with the salesperson are filtered out.

Next the switchboard appears and requires the user to select a date range from a pulldown.

The user then decides to print a report of to update the data. The program has filtered the files where only the ones prepared by the user (tblSP) and created during the range selected (tblDR) will appear. The user will only see records associated with him or her. All reports will show all records but updates will automatically be limited to those associated with the user and covered during the date range selected. This will allow the reports to show everything but the user can modify or delete only their records.

All of the above has been created and is ready EXCEPT, I don’t know how to capture the User’s name and date range for filtering or querying. Please help with setting up the filtering or query process.
 
If the user is selecting their name from a list on a form the easiest way would be to hide the form and reference the control on the form that contains their name.

Forms!FormName!ControlName.value

Alternatively, you can store the selected username in a global variable for use everywhere.

Your date issue can be addressed by the same method

With VBA you can grab the login name for the current user if you're using network logins. This way you don't need to worry about logon forms. Simply write a function that will read the network login name from Windows.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top