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

Query and multiple tabels in form

Hi all,

I have the following problem:
Situation: Access 2000 database with VBA code.
Depending on the 'grade' of our product, we need to enter the weight of some sieves we use on a regular base. I now have a form in wich you can select the 'grade' in a listbox, and then it sets the recordsource for the form to the table with the weights for that grade. Now, I just found out that we have multiple sieves per grade, and that each sieve has its own unique number. I figured that I'd make another combo-box where you can enter or choose the sievenumber (called BMA nr) and then enter the weight of the sieve.

but how do I do that? I suspect i need to make a query, and that will work with just reading old data, but what happens if someone needs to enter a new BMA nr. with new sieve weights?

Here's what I have now:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub SieveGrade_Change()
  3.  
  4.   Select Case SieveGrade.Value
  5.     Case "1"
  6.       Form_frmUCLeeggewichtZeven.RecordSource = "UC_LeeggewichtZeef"
  7.     Case "2"
  8.       Form_frmUCLeeggewichtZeven.RecordSource = "MG_LeeggewichtZeef"
  9.     Case "3"
  10.       Form_frmUCLeeggewichtZeven.RecordSource = "PF_LeeggewichtZeef"
  11.     Case "4"
  12.       Form_frmUCLeeggewichtZeven.RecordSource = "GP_LeeggewichtZeef"
  13.     Case "5"
  14.       Form_frmUCLeeggewichtZeven.RecordSource = "PFDryer_LeeggewichtZeef"
  15.     Case Else
  16.       MsgBox "Error!", vbCritical
  17.       Exit Sub
  18.   End Select
  19.  
  20. End Sub
  21.  
  22.  
I have another listbox that I want to fill with data from one of the tables (e.g. GP_LeeggewichtZeef), and when the user chooses an item in this list, I have some fields where they can either read existing data or enter new.


Anyone with some cool tips/advice/code, please please please? :)

Regards,

Jasper
Jul 27 '07 #1
1 1154
MMcCarthy
14,534 Expert Mod 8TB
Hi Jasper

Have a look at this tutorial ...

Cascading Combo/List Boxes
Aug 6 '07 #2

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

Similar topics

5
by: Bill | last post by:
I have a book cataloge where I have an author id linked up to the book. However, I'm finding that some books have mulitple authors, and I'm wondering if there is a way to add more than one id to...
1
by: Robert Neville | last post by:
The solution to my dilemma seems straight-forward, yet my mind has not been forthcoming with a direct route. My Project form has a tab control with multiple sub-forms; these distinct sub-forms...
2
by: Josh Felker | last post by:
Hey everyone. I have a daily log form with my investing info. In that form I have 2 subforms, the first shows my profits on all the stocks I traded that day, the second shows my profits on...
0
by: starace | last post by:
I have designed a form that has 5 different list boxes where the selections within each are used as criteria in building a dynamic query. Some boxes are set for multiple selections but these list...
1
by: hmiller | last post by:
I'm sorry to populate the server with yet another question about linking multiple tables and queries, howerver I have not been able to find the right criteria. My problem. I am trying to...
5
by: mimo | last post by:
Hello, I have seen samples on how to pull data from one table and save back to it using the Form View control. How do I pull from multiple tables and save back to multiple tables on one...
2
by: Metalzed | last post by:
I have 4 tabels tbOWNERS // PLAYERS ID , NAME 1 Mike 2 Rambo 3 Sam tbCARS // CARS THAT EXIST AND WHO OWNS THEM
4
by: TechnoAtif | last post by:
Hi ALL I have entered some array values using checkboxes into mysql database through a form. Next iam creating a searchpage where all those cateogories inserted through checkboxes has to be...
3
by: sasharad | last post by:
Is it possible to create a query in one Access MDB file that references tabels in other MDB files?
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...
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...
0
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.