By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 2,028 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

getting user input through VBA

P: 1
Hi All,
I am trying to use the user input in my form which is using a stored query.

Here is the stored query:
Expand|Select|Wrap|Line Numbers
  1. SELECT Accounts.balance,
  2.        Accounts.transactionDate,
  3.        Accounts.credit,
  4.        Accounts.debit,
  5.        Accounts.Details,
  6.        Accounts.tradePeriod,
  7.        Accounts.monthName,
  8.        Accounts.CustomerID,
  9.        Header.Address1,
  10.        Header.Country,
  11.        Header.[Date Allocated],
  12.        Header.Email,
  13.        Header.Fax,
  14.        Header.FirstName,
  15.        Header.FirstName,
  16.        Header.HomePhone,
  17.        Header.MobilePhone,
  18.        Header.Organisation,
  19.        Header.Postcode,
  20.        Header.State,
  21.        Header.Suburbl,
  22.        Header.Surname,
  23.        Header.Title,
  24.        Header.DateJoined,
  25.        Header.WorkPhone,
  26.        Accounts.ClientNumber,
  27.        Header.ContractPrice
  28.  
  29. FROM Accounts RIGHT JOIN Header
  30.   ON Accounts.ClientNumber = Header.ClientNumber
  31.  
  32. WHERE (((Accounts.transactionDate) Between [transactions between date] And [latest date])
  33.   AND ((Accounts.ClientNumber)=[Enter Client Number]));
The three inputs are in bold. And I would like to use them in the form. I know I could use a recordset to do this, but I was hoping there was some sort of variable that access stores the query inputs in...

Many thanks,

Shaun
Oct 22 '08 #1
Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,306
You would need to change the parameters (which cause the prompts) into references to controls on your form I'm afraid.

There will be problems if this is attempted when the form is not open.
Oct 22 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.