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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I want to aviod "Enter Parameter Value" box to pop up

Status
Not open for further replies.
Jan 5, 2004
34
US
My SQL statement works fine but I want to aviod "Enter Parameter Value" box to pop up for form filed entry.
What is wrong with tis statement that It cannot read the form input itself? do not want to do it in VBA.

SQL:
SELECT ContactGroups.ContactType, ContactGroups.ContactAddress
FROM ContactGroups
WHERE ((([ContactGroups].[GroupID])= Forms![Contact Input]![txtGroupID]));

I may have posted this as a reply to another issue last night by accident, sorry about that.

Thanks

Email Service Free from Banner ads.
 
make sure that the form is open before calling the sql/query


Program Error
Programmers do it one finger at a time!
 
Something like this (in the AfterUpdate event procedure of txtGroupID) ?
Me![combo name].RowSource = "SELECT ContactType,ContactAddress FROM ContactGroups WHERE GroupID=" & Me![txtGroupID]
If GroupID is not defined as numeric in ContactGroups:
Me![combo name].RowSource = "SELECT ContactType,ContactAddress FROM ContactGroups WHERE GroupID='" & Me![txtGroupID] & "'"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
clickaccess,

There is nothing obviuosly wrong with your SQL statement. When do you get the parameter popup? In any event, when the parameter data changes, the combo must be requeried to account for the new data. Unless you expect your users to hit F9 to refresh the form whenever the data in txtGroupID changes, you will have to use some VBA code to do it automatically. PHV has shown you one method - when you set the combo's RowSource in code, the control is automatically requeried. Another way, also in the AfterUpdate event of txtGroupID is Me!ComboName.Requery or for more of a sledgehammer approach, Me.Recalc.

HTH,

Ken S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top