getting user input through VBA

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shaunhh
    New Member
    • Oct 2008
    • 1

    getting user input through VBA

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

    Here is the stored query:
    Code:
    SELECT Accounts.balance,
           Accounts.transactionDate,
           Accounts.credit,
           Accounts.debit,
           Accounts.Details,
           Accounts.tradePeriod,
           Accounts.monthName,
           Accounts.CustomerID,
           Header.Address1,
           Header.Country,
           Header.[Date Allocated],
           Header.Email,
           Header.Fax,
           Header.FirstName,
           Header.FirstName,
           Header.HomePhone,
           Header.MobilePhone,
           Header.Organisation,
           Header.Postcode,
           Header.State,
           Header.Suburbl,
           Header.Surname,
           Header.Title,
           Header.DateJoined,
           Header.WorkPhone,
           Accounts.ClientNumber,
           Header.ContractPrice
    
    FROM Accounts RIGHT JOIN Header
      ON Accounts.ClientNumber = Header.ClientNumber
    
    WHERE (((Accounts.transactionDate) Between [[B]transactions between date[/B]] And [[B]latest date[/B]])
      AND ((Accounts.ClientNumber)=[[B]Enter Client Number[/B]]));
    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
    Last edited by NeoPa; Oct 22 '08, 01:25 PM. Reason: Please use the [CODE] tags provided
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32654

    #2
    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.

    Comment

    Working...