473,378 Members | 1,522 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,378 software developers and data experts.

I can't get a second combo box data to be defined by the first combo box.

I am using Access 2007 trying to use combo box 1 named zone to define which data is shown in combo box 2 named cell. The code is as follows;
Expand|Select|Wrap|Line Numbers
  1. Private Sub Zone_AfterUpdate()
  2.     ' Update the row source of the cboCell combo box
  3.     ' when the user makes a selection in the cboZone
  4.     ' combo box.
  5.     Me.cboCell.RowSource = "SELECT Cell FROM" & _
  6.                                " tblCells WHERE Zone = " & _
  7.                                Me.cboZone & _
  8.                                " ORDER BY Cell"
  9.  
  10.     Me.cboCell = Me.cboCell.ItemData(0)
  11.  
  12. End Sub
The error message I get is " Compile error
Method or data member not found.
Aug 12 '15 #1
6 1086
dsatino
393 256MB
I think you need to requery cboCell after you set the rowsource
Aug 12 '15 #2
Rabbit
12,516 Expert Mod 8TB
Which line is the error on?
Aug 12 '15 #3
Hello Rabbit,
It is on "Me.cboCell.RowSource" is highlighted in blue. This is my first attempt at building a database like this. I have not had any classes on this so I am pretty much flying blind here. Thanks for helping
Aug 12 '15 #4
Rabbit
12,516 Expert Mod 8TB
Check the names of your controls. You said the combobox is named cboZone, however, your event is Zone_AfterUpdate and not cboZone_AfterUpdate. So it's likely one of them is wrong.
Aug 12 '15 #5
I am attaching more information so you can see what I have created. I can't immediately find my error, but then again I ma rather new to all of this.

Database Parts
Tables
Zones ID Autonumber Key
Zone Text

Cells ID Autonumber Key
Cell Text
Zone Text

Category ID Autonumber Key
Category Text

Form
Parts ID Autonmuber Key
Zone Text Combo Box
Select Zones.Zone, Zones.ID From Zones ORDER BY Zones.Zone;
Cell Text Combo Box
Select Cells.ID, Cells.Cell, Cells.Zone From Cells ORDER BY Cells.Cell
Unit Text
Category Text
Item Text
Model Text
Manufacturer Text
Description Memo
Purchase Currency
Attachments Attachment
Aug 13 '15 #6
Rabbit
12,516 Expert Mod 8TB
Thanks for the extra info but my suggestion doesn't change from post #5. The names of your controls on your form don't match what's in your code, so that's probably where the issue lies. Fix the names by either renaming the controls or fix the code by using the correct control name.
Aug 13 '15 #7

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

Similar topics

2
by: D | last post by:
Book inventory. Access 2K. I'm trying to let a user choose a book title from one combo box, then a book number for that book title from another combo box. I can filter the book number combo with...
7
by: Lian | last post by:
Hi every body I have a problem with accesses and visual studio. I've just installed XP and I can't get a connection with the Data base. I have this error and I don't know how to fix it The...
4
by: bienwell | last post by:
Hi all, I'd like to use TRY, CATCH to open my database connection. I have 2 servers that have the same table name "myTable". If the first connection to Server1 is failed, then the program will...
4
by: Miguel | last post by:
I have synchronized combo boxes linking Account Type with Customer Names based on the template that Microsoft has in one of its samples databases. There are the appropriate relationships between...
4
by: tneufeld | last post by:
I am using a ListView control to display 2 columns of data that I populate manually. I can get the data in the first column easily enough. its when i try to get the data in the second column...
13
by: marsh07 | last post by:
I created a form that contains two combo boxes plus other information. The first combo box contains the following items: (Claim Under $5000, PIR/CPRA, Potential Claim, CA Vic Comp, Summons&Complaint,...
0
by: sarvmardan | last post by:
how to open a report in access containing filtered data using two combo boxes on form and a button to click. let i have two fields and other is . two comboboxes are combo11 and combo9. plz post...
5
by: Haagimus | last post by:
I am trying to create an access form that will have multiple combo box drop downs. There are two that will need to be linked in the form. The selection of the first will need to become the query...
3
by: rod4 | last post by:
Hello guys, i have made a data entry form with two combo boxes. The first one called from the table with the row source: SELECT ., . FROM company;
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...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.