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

Help with Combo Box Logic/VBA

1
I am currently working on an Access dbs for work. I have been thinking about how to do for awhile and still haven't figured this out (I am also somewhat of a newbie to Access).

The dbs is comprised of 18 tables including junction table. The main tables in questions are:

Request which has a M:M relationship with Client
Client which has a 1:M relationship to Program

What I am trying to do is in the Request form have a client subform where multiple clients can be associated to the Request

The subform is based on a query with Request, Client, Client Request junction
has the client, program fields

What i need to have done is for the user to be able to select the client from the client list box and then the program list box to be defaulted to a program associated with the client. If more than one program under the client exist then the user can click on the program list box to select the appropriate program associated with the client. The list box at this point should only display programs associated to the client. At the same time, the user should also be able to select from the program list box and then automatically populate the client info -- meaning the user have two ways to populate these two fields > via program or client

I believe VBA is the way to go since there could be two rowsources for Program Id listbox.... I tried various codes i can muster, but none worked.

Any help on this would be great.

Thanks!
Feb 27 '08 #1
2 1389
StephR
18
I just tried the same thing with my database... I ended up making a find command button on the main form, which would then show all the records in the subform that I wanted.

Also, I had to go back and click "cascade updates" in the relationship (between the form and subform) to allow the user to enter information both ways.

Does that help any?

Stephanie
Feb 27 '08 #2
Stewart Ross
2,545 Expert Mod 2GB
...Also, I had to go back and click "cascade updates" in the relationship (between the form and subform) to allow the user to enter information both ways...
Hi all. 'Cascade Updates' is a setting that ensures that any changes to the primary key value on the 'one' side of a one-to-many relationship are updated through all associated secondary keys in tables on the 'many' side of the relationship. If Cascade Updates is not set then once a related record is present no change to the primary key value is allowed (to avoid orphaning the related record).

This setting otherwise does not have anything to do with getting forms and subforms to work...

In the first post where the MM relationship is mentioned, has this been properly normalised to two 1-M relationships with a linking table in between? If not it should be, as try as you might you will not be able to use forms and subforms correctly on un-normalised data...

The HowTo section of the forum has a good article on database design and normalisation, at http://www.thescripts.com/forum/thread585228.html.

-Stewart
Feb 27 '08 #3

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

Similar topics

15
by: Philip Mette | last post by:
I am begginner at best so I hope someone that is better can help. I have a stored procedure that updates a view that I wrote using 2 cursors.(Kind of a Inner Loop) I wrote it this way Because I...
2
by: Steve | last post by:
Access 97. I have a form where there is an option group with two buttons, and a combo box. The combo box Row Source is a query. The option group has two options a) include a subset of the...
14
by: alwayshouston | last post by:
Hi All! I am working on this very small database and I am confused in the designing a simple form. I only have three tables in the database. First Table: tblExpense Columns: ExpenseID ;...
2
by: Robert | last post by:
Am using a nested continuous bound subform to add multiple records to the underlying table. One of the fields is based on a limit to list combo box. Any suggestions on best way to progressively...
0
by: Tom | last post by:
I have some very strange issues with combo boxes on a tab control. Here's the scenario: I have a Windows Forms form that has a tab control on it, with two (2) tabs. Tab 2 happens to have a number...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
3
by: Phil | last post by:
I've posted this a few times without any luck, hoping for some fresh ideas on this. I'm pretty certain this can be done. I've been using a micrsoft template to create a supplier database called...
2
by: Lumpy | last post by:
This question isn't relating to some specific piece of code, but more along the lines of the logic or best method I should use with access 2003 and VBA. I am new to access programming and I am...
30
ADezii
by: ADezii | last post by:
This week’s Tip of the Week will clearly demonstrate how you can dynamically set the Drop Down List Width of a Combo Box to the length of the longest item in its Row Source. The inspiration for this...
1
by: onlinegear | last post by:
HI i am writing this for college i know i have loads of combo boxes with nothing in the i havent got that far yet. but every time i run this is comes up with this erro run: Exception in thread...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.