APD Toronto
asked on
Dropdowns in Queries
Hello Experts,
I am trying to build a MS Access query that I want to present to the user as a subform that they will edit, but when I run the query, I don't know how to get all of the users to show up from the tblUsers in a dropdown?
Here is what my query looks like so far:
Thank you
I am trying to build a MS Access query that I want to present to the user as a subform that they will edit, but when I run the query, I don't know how to get all of the users to show up from the tblUsers in a dropdown?
Here is what my query looks like so far:
SELECT [tblUsers].[fldFName] & " " & Left([tblUsers].[fldLName],1) & "." AS [User], tblReservations.fldUserInit AS ['User Initials'], tblReservations.fldReservID
FROM tblReservations INNER JOIN tblUsers ON tblReservations.fldUser = tblUsers.fldUserID
WHERE (((tblReservations.fldTripSubType)=[Forms]![frmDiscrepDetails]![txtTripID]));
Thank you
subform that they will edit, but when I run the query,As fyed mentions, you can't do this in a query, but if you're using this to bind to a subform, then you can just add the Combo to the subform and use that. You can then setup the combo as needed, and your users will be able to select an item from the dropdown.
ASKER
My goal is to end up with a tabular form that has combo boxes that user updates
Any quick wat to do this
Any quick wat to do this
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes I am trying to allow the user to edit data. I don't need to filter.
I am now using a continuous form, but I need to edit 1 field by code as shown below, but all my rows get the same value with this code.
I am now using a continuous form, but I need to edit 1 field by code as shown below, but all my rows get the same value with this code.
txtConf = fldUser.Column(2, fldUser.ListIndex) & " " & fldReservID
ASKER
I figured out that I cannot do that with unbound controls, but yes I needed a continuous form.
However, if you are going to use that query in a report, you could use the reports Open event to popup a form, allow the user to make a selection from the combo box on that form, then refer to that form in the query.
When I do this, I put Cancel and Select buttons on the form. When the user selects either of these buttons, it updates the Tag property of the form to either "Cancel" or "Select", and then hides the form. When this happens, the rest of the code in the Report_Open event continues.
If the user selects Cancel, I set the Cancel parameter of the Report_Open event to true. If the user clicks the "Continue", then the report opens and uses the parameter in that form for the query.
Finally, the Report_Close event closes the popup form. This does not provide quite the same functionality as you have described, but it works for reports.
Open in new window