473,327 Members | 2,012 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,327 software developers and data experts.

ComboBox to Open a Different Form/Record

I'm an access novice, so perhaps this is a no brainer....

I am trying to use a combo box on one form (called Menu) to pull a different form (called Aircraft Arrivals) based on the name of an aircraft (assigned as aircraft name in table). So, if I want to see the particular info on say RedPlane1, I select this from the combo box and the form & data, already entered, on RedPlane1 comes up. Any suggestions?

Thanks.
Jan 20 '07 #1
4 2118
nico5038
3,080 Expert 2GB
Easiest to create a formwith all planes.
Next place a combobox with the wizard and select the third option "Search for a record".

Now all planes can be scrolled through,but also positioned with the search combo.

Idea ?

Nic;o)
Jan 21 '07 #2
Thanks for the quick reply. When I place the combo box on the form, I only get two choices.

So here is what I was trying to do in code:

On the main menu, I have a combo box (cmbfindaircraft) that is populated with aircraft names from a query table. I am trying to open the "frmaircraftArrival Form" that displays data for that aircraft.


Expand|Select|Wrap|Line Numbers
  1. Private Sub cmbfindaircraft_AfterUpdate()
  2.     Dim stDocName As String
  3.     Dim stLinkCriteria As String
  4.  
  5.     stDocName = "frmaircraftArrivalForm"
  6.     stLinkCriteria = "[Aircraft Data Table Query]![Aircraft name]=[Forms]![frmMenu]![cmbfindaircraft]"
  7.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  8.  
  9. cmbfindaircraft_AfterUpdate_Exit:
  10.     Exit Sub
  11.  
  12. cmbfindaircraft_AfterUpdate_Err:
  13.     MsgBox Error$
  14.     Resume cmbfindaircraft_AfterUpdate_Exit
  15. End Sub
Unfortunately, this doesn't seem to work....

As a temp work around, I create a button that will pull a record based on the name in the combo box. It works but it would be nice to remove the extra key strokes from the process.

Thanks.
Jan 21 '07 #3
nico5038
3,080 Expert 2GB
Thanks for the quick reply. When I place the combo box on the form, I only get two choices.

So here is what I was trying to do in code:

On the main menu, I have a combo box (cmbfindaircraft) that is populated with aircraft names from a query table. I am trying to open the "frmaircraftArrival Form" that displays data for that aircraft.


Expand|Select|Wrap|Line Numbers
  1. Private Sub cmbfindaircraft_AfterUpdate()
  2.     Dim stDocName As String
  3.     Dim stLinkCriteria As String
  4.  
  5.     stDocName = "frmaircraftArrivalForm"
  6.     stLinkCriteria = "[Aircraft Data Table Query]![Aircraft name]=[Forms]![frmMenu]![cmbfindaircraft]"
  7.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  8.  
  9. cmbfindaircraft_AfterUpdate_Exit:
  10.     Exit Sub
  11.  
  12. cmbfindaircraft_AfterUpdate_Err:
  13.     MsgBox Error$
  14.     Resume cmbfindaircraft_AfterUpdate_Exit
  15. End Sub
Unfortunately, this doesn't seem to work....

As a temp work around, I create a button that will pull a record based on the name in the combo box. It works but it would be nice to remove the extra key strokes from the process.

Thanks.

You need to position to the specific row like:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmbfindaircraft_AfterUpdate()
  2. dim rs as Object
  3.  
  4. set rs = me.recordset.clone
  5. rs.findfirst "[<Id you're looking for>] = " & cmbfindaircraft
  6. Me.Bookmark = rs.Bookmark
  7.  
  8. End Sub
The <Id you're looking for> needs to be replaced with the (numeric) ID fieldname. When your keyfield is text add surrounding quotes.

Nic;o)
Jan 21 '07 #4
NeoPa
32,556 Expert Mod 16PB
This link (Example Filtering on a Form.) may help with this situation.
Jan 22 '07 #5

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

Similar topics

1
by: Oren Kaplan | last post by:
Hello, I posted a msg on the Access-related groups in hope someone there could help me but since almost two days have past and I didnt get a response (Im a bit hard pressed with the problem) I...
1
by: George Raetz | last post by:
Greetings, I open the "Northwind" sample data base in Access 2003. In the "Orders" form there is a "CustomerID" combobox labeled "Bill To". I scroll thru the list in the combobox and make a...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
0
by: Susan Bricker | last post by:
The following error: "The current field must match the join key '?' in the table that seves as t the 'one' side of one-to-many relationship. Enter a record in the 'one' side table with the...
2
by: Susan Bricker | last post by:
I went back to read my post and found an error in my description ... here is the post, again, corrected: The following error: "The current field must match the join key '?' in the table that...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
12
by: eetarnold | last post by:
Hi Gurus, As I've read in other posts the past couple of days, I've read many great posts and haven't figured out how I can solve this problem...I'm trying to make a form very user friendly for...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
3
by: Steve King | last post by:
I'm attempting to bind a combobox to store the values in tblProblems.VersionID and display the Version value from the tblVersions. The VersionID field is a foreign key to the ID in tblVersions. ...
4
by: JJGarcia | last post by:
Hi Everyone, I'll try to explain the process I'm following, I'm new to this so I'm triying the easy way first, probably the lasyest too! I created a new Project, drag in to it a SQLConnection,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.