473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How do I query a subform from a cbo?

Hi,

I'm using MS Access 2007.

I have a form, card_file, with an embedded subform, card_access_point_file.

I would like to create a combobox on the main form to query the card_file on values in a field on the card_access_point _file. Specifically, I would like the combobox to query the card_access_point_file.accesspoint_entry field.

I have tried to do this as follows, where SAPE is the name of the cbo box, but I'm doing something--possibly many things--wrong.

Any help you can provide is greatly appreciated.

John

Expand|Select|Wrap|Line Numbers
  1. Private Sub SAPE_Button_Click()
  2.  
  3. Dim stDocName As String
  4. Dim stLinkCriteria As String
  5.  
  6. stDocName = "card_file"
  7. stLinkCriteria = "Forms!card_file!card_access_point_file.Form.acces spoint_entry LIKE" & "'*" & Forms!card_file!SAPE & "*'"
  8. DoCmd.OpenForm stDocName, , , stLinkCriteria
  9.  
  10. Exit_SAPE_Button_Click:
  11. Exit Sub
  12.  
  13. Err_SAPE_Button_Click:
  14. MsgBox Err.Description
  15. Resume Exit_SAPE_Button_Click
  16.  
  17. End Sub
Nov 19 '10 #1
1 1323
NeoPa
32,556 Expert Mod 16PB
This sounds like you could benefit from reading Example Filtering on a Form, and also, possibly, Referring to Items on a Sub-Form.
Nov 19 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
9
by: PC Datasheet | last post by:
I'm stuck on something that seems should be easy and I need some help. My main form has an option group with five options. My subform chooses from different lists depending on which option is...
1
by: Stephen D Cook | last post by:
I have a form with txtSN text box, btnShow button, and a subform. The form is bound to a Table. The button is bound to a lookup query. The query is bound to the text box. I want to be able to...
0
by: Stephen D Cook | last post by:
I have a form linked to a table. In the form I have a textbox, a command button, and a query subform. I dragged the query onto the form to create the query subform. The query has a field named...
1
by: Parasyke | last post by:
I have a mainform named "SearchByManufacturer" that has a subform (in DataView form) named "Products Query Subform" which get its data from a query called "Products Query" based on a table called...
1
by: Stinky Pete | last post by:
Hi everyone, I have been updating a file that uses a main form that contains a subform (as a datasheet). The main form really does not do anything on opening except maximizes to the users...
2
by: dbdb | last post by:
Hai, need a help please. i have a form to view the query subform 1. form name : form1 2. query subform name : subform1 3. textbox name : txtclass1 4. command button name : cmd1 i want to...
13
by: darnnnel | last post by:
Hi this is what i have so far, but it doesnt seem to be working right. I am getting an error here: qryReferral.Status = 'Open' Private Sub cmdFltrOpen_Click() Dim sSQL As String ...
0
by: Gordon Padwick | last post by:
A form contains controls, one or more of which can be other forms. A form that contains another form is known as a main form. A form contained by a main form is known as a subform. A subform itself...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.