![]() |
|
|
#1
|
|||
|
|||
|
Hi all, I'm reworking a previous database for my company's inventory. The previous database is horribly convoluted, and I'm trying to simplify things. To enter the "Edit Inventory" form, two parameters must be passed to the "Edit Inventory" query (in this case, "Supplier Style Number" and "Lot Number"). At the moment, these parameters are passed through simple, default dialog boxes. However, I would like to use a custom dialog box with combo boxes to enter the query parameters. I've already created the form and referenced the combo boxes in the query's Parameter field, yet the old prompts pop up instead, with the form references (i.e. [Forms]![frmQry]![SSN]) as the caption of the prompt. The references seem fine to me, I don't know where the hole is that prevents the query from recognizing the form. This is somewhat time-sensitive and I'd appreciate any help!
|
|
#2
|
||||
|
||||
|
Clear the RecordSource from the form and save it and then set it to the query again. Would you believe Access keeps a hidden copy of the old query.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07 If your issue is resolved...follow this link for directions on how to use the Solved thread tool! Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus" |
|
#3
|
|||
|
|||
|
Well the whole RecordSource thing didn't work out, but since you said that Access keeps a hidden copy of the query, I just remade the query and it worked perfectly! Thank you so much!
|
|
#4
|
||||
|
||||
|
Glad I could help. Are we ready for the Solved thread tool yet?
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07 If your issue is resolved...follow this link for directions on how to use the Solved thread tool! Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus" |
|
#5
|
|||
|
|||
|
Ah, bad news. A new problem came up. When I enter two parameters I know to be valid using the query from the form, it returns a blank datasheet. In fact, all values from the form return a blank datasheet. I tested the values manually and they work. Is this a problem with datatype (i.e. the query not recognizing the right datatype from the combo box)? Or is there something else fishy?
|
|
#6
|
||||
|
||||
|
I would not let Access determine the datatype since it can get it wrong. Use explicit functions to Type your data. How about posting the SQL view of your query so we can look at it?
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07 If your issue is resolved...follow this link for directions on how to use the Solved thread tool! Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus" |
|
#7
|
|||
|
|||
|
No need, I figured out the problem! The combo boxes look up fields in a table, and apparently since the data in the tables has to be paired with a primary key field, the query couldn't recognize the value. I cheated and wrote a script to take the combo box value and transfer it to an invisible text box, and then using the text box as the query parameter. All is working smoothly now. Thanks again for your support, and I apologize for my vague description of the problem. Solved!
|
|
#8
|
||||
|
||||
|
Ouch! Using the hated Lookup Fields in your tables. At least you got things working and thanks for marking the thread.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07 If your issue is resolved...follow this link for directions on how to use the Solved thread tool! Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus" |
|
#9
|
|||
|
|||
|
Whew...that article scares me. However, I don't think I'm using Lookup Fields in my tables. This is the SQL in the Row Source property of my combo boxes:
SELECT [public_Inventory].[Raw Material Entry], [public_Inventory].[Supplier Style Number] FROM [public_Inventory] ORDER BY [Supplier Style Number]; SELECT [public_Inventory].[Raw Material Entry], [public_Inventory].[Lot Number] FROM [public_Inventory] ORDER BY [Lot Number]; I checked the Lookup tabs in my two tables and they were empty. Am I really using Lookup Fields? I really want to avoid bad Access practices, which is why I'm remaking the database in the first place...
|
|
#10
|
||||
|
||||
|
The Lookup tab of the field will have a ComboBox and an SQL statement if you are using Lookup Fields.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07 If your issue is resolved...follow this link for directions on how to use the Solved thread tool! Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus" |
|
#11
|
|||
|
|||
|
Whew! I think I'm safe then. Thanks!
|
|
#12
|
||||
|
||||
|
Good! Have fun with the rest of the project.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07 If your issue is resolved...follow this link for directions on how to use the Solved thread tool! Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus" |
|
| Bookmarks |
| Tags |
| combo box, custom query, parameter, prompt |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Display Query Value That Requires Input Parameter | Access::Student | Access | 1 | 05-29-2009 06:43 PM |
| Problem with parameter driven combo box | clydet2 | Queries | 0 | 04-06-2009 10:19 AM |
| Display Query Parameter In Report With No Data | Dr Do | Reports | 6 | 02-20-2009 08:50 AM |
| Run Query without prompts | gailoni | Queries | 4 | 11-02-2008 10:42 PM |
| Add combo box to parameter query | louisa14 | Queries | 1 | 12-10-2005 05:38 AM |