Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 8th, 2012, 12:36 PM
Registered User
Points: 31, Level: 1
Points: 31, Level: 1 Points: 31, Level: 1 Points: 31, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2009
Posts: 7
Thanks: 3
Thanked 0 Times in 0 Posts
Default subform combobox problem

Hi - I've been tearing my hair out with this, so I hope someone can help.

I have an access 2007 mdb front end which links to a sql 2008 server instance.

I have created a main form which holds data pertaining to cases, on this there is a continous subform holding information about people and is incorporating two tables, table people and table contact info. the info on people includes ethnicity info which is spread over three combo boxes, main category, subcategory and other. these comboboxes are fed from three different tables, however, the choices in the subcategory combo box are dependent on what was chosen in the main category. so, in the after update event of the main category I put a me.subcategorycombobox.requery event. the sub category combobox is sourced by by a "select all where maincategoryID is like [forms]![subform]![maincategorycombobox]".

Now this all works fine when I open the subform on it's own, however, when opening the main form with the subform on it, the comboboxes cannot display correct data and throw me a parameter request instead. none of the requerying seems to be happening either. I have no idea what the problem is, so would really appreciate any help. Thank you. B
Reply With Quote
  #2 (permalink)  
Old August 8th, 2012, 01:01 PM
Authorized User
Points: 346, Level: 6
Points: 346, Level: 6 Points: 346, Level: 6 Points: 346, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2010
Posts: 61
Thanks: 0
Thanked 13 Times in 13 Posts
Default

Hi,

This is because "subform" is no longer in the Forms collection, but the "mainform" is.

You can change the SQL to use
[Forms]![mainform_name]![subform_control]!maincategorycombobox].

Alternatively, you could update the subcategorycombobox's rowsource property with the actual value of the main category in the AfterUpdate event of the maincategorycombobox .

HTH.

Malc.
Reply With Quote
The Following User Says Thank You to malcolmdixon For This Useful Post:
BabaYaga (August 8th, 2012)
  #3 (permalink)  
Old August 8th, 2012, 01:16 PM
Registered User
Points: 31, Level: 1
Points: 31, Level: 1 Points: 31, Level: 1 Points: 31, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2009
Posts: 7
Thanks: 3
Thanked 0 Times in 0 Posts
Default

darn! of course! named it properly and it solved the problem. Thank you. B
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subform problem fatrich Access VBA 6 October 4th, 2007 08:02 PM
Filling SubForm from ComboBox ayazhoda Access VBA 4 June 5th, 2007 10:56 AM
Print subform problem J.K.W.Y. Access 4 April 25th, 2006 06:21 AM
Ids problem on subform ailyn Access VBA 1 December 9th, 2005 05:30 PM
Access SubForm Problem jscully Access 9 August 29th, 2005 03:03 PM



All times are GMT -4. The time now is 06:34 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.