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

Combo Box questions

I have two lists of suppliers (internal and external) for an NCR (Non-Conformance Report) database (Supplier Rating System) on a form. Currently we use a combo box to drop down the Internal Suppliers. However, I need to be able to add a check box or other control that chooses which list to provide. Combining the two is not an option....The list of external vendors is a pass-through query to our ERP system. Also, I use Joins in many many many of my queries to differentiate between internal and external suppliers, so combining them is not an option. How would be the best way to handle this?
Jun 12 '07 #1
14 1884
NeoPa
32,556 Expert Mod 16PB
Have a CheckBox on the form for Internal/External.
In the AfterUpdate event procedure, set up the ComboBox RecordSource et all properties.
Jun 13 '07 #2
Have a CheckBox on the form for Internal/External.
In the AfterUpdate event procedure, set up the ComboBox RecordSource et all properties.

Do you have an example? I have never done this before.
Jun 13 '07 #3
NeoPa
32,556 Expert Mod 16PB
If you set up the basic form with the required controls on it and post the names of all of them we'll see what we can do to make it update.
I will also need the two different versions of the RecordSource strings you need.
Jun 13 '07 #4
how do i send this to you?
Jun 13 '07 #5
NeoPa
32,556 Expert Mod 16PB
All the things I've asked for are strings, so can be posted in here.
Jun 13 '07 #6
All the things I've asked for are strings, so can be posted in here.
?? Still confused about what you need then. Please be patient cause I am no way near being an expert in this. You say these things are strings however I am not sure what you mean. So talk to me as if I dont know anything. =)
Jun 13 '07 #7
NeoPa
32,556 Expert Mod 16PB
If you set up the basic form with the required controls on it and post the names of all of them we'll see what we can do to make it update.
I will also need the two different versions of the RecordSource strings you need.
An example of what I asked for would be something like :
Expand|Select|Wrap|Line Numbers
  1. Form Name = frmNCR
  2. Control (CheckBox) = chkInternal
  3. Control (ComboBox) = cboSuppliers
  4. RecordSource (when in Internal mode) = qryInternalSuppliers
  5. RecordSource (when in External mode) = qryExternalSuppliers
Obviously I don't know what you've got though so this is simply an example. I need to know what you've got in reality. Please be as accurate as you can and don't miss anything out as returning to ask for things again will just slow the whole process (We'll do it if we must though - I'm not planning on leaving you in the lurch any time soon).
Jun 13 '07 #8
Okay, Now I know what you mean and I think I know what you need.

Okay currently I don't have the checkbox but this is what I will be adding:

Expand|Select|Wrap|Line Numbers
  1. Form = frmMasterEntry
  2. Control  (Checkbox) = chkExternal
  3. Control (Combo Box)= cbosuppname (currently bound; control source = SuppName row source= tblSupplier)
  4. Recordsource (when Intenal)= tblsupplier;  SuppName (text)
  5. Recordsource (when External) = qryMacolaVendA;  VendName (text)
Jun 13 '07 #9
NeoPa
32,556 Expert Mod 16PB
That seems to be the business.
I'll see what I can come up with for you today if possible.
Jun 13 '07 #10
NeoPa
32,556 Expert Mod 16PB
Try the following as a starting point :
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Private Const conInternal As String = "SELECT [SuppName] FROM [tblSupplier]"
  5. Private Const conExternal As String = "SELECT [VendName] FROM [qryMacolaVendA]"
  6.  
  7. Private Sub chkExternal_AfterUpdate()
  8.   Me.cboSuppName.RowSource = IIf(Me.chkExternal, conExternal, conInternal)
  9.   Call Me.cboSuppName.Requery
  10. End Sub
Jun 13 '07 #11
Try the following as a starting point :
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Private Const conInternal As String = "SELECT [SuppName] FROM [tblSupplier]"
  5. Private Const conExternal As String = "SELECT [VendName] FROM [qryMacolaVendA]"
  6.  
  7. Private Sub chkExternal_AfterUpdate()
  8.   Me.cboSuppName.RowSource = IIf(Me.chkExternal, conExternal, conInternal)
  9.   Call Me.cboSuppName.Requery
  10. End Sub
Thank you!! Though for some reason it works one-dirction only. If for some reason the data entry person clicks on it accidentally then unclicks the combo list is blank, it doesn't return to tblSupplier list.
Jun 14 '07 #12
NeoPa
32,556 Expert Mod 16PB
Have you tried tracing the code to see what goes wrong?
Put a breakpoint on line 8 and see what happens. See Debugging in VBA for help on tracing.
Jun 14 '07 #13
Never done any debugging....Wouldn't have a clue where to start.
Jun 15 '07 #14
NeoPa
32,556 Expert Mod 16PB
That's why I posted the link - let me know if you have any dificulties after reading the article.
Jun 15 '07 #15

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

Similar topics

1
by: Daniel Hill | last post by:
OK, I have very, VERY basic background knowledge of VB6 and have now upgraded to VB.NET and now I'm struggling to bring up the forms I want. What I am looking to do is to have a click a command...
1
by: FZ | last post by:
Hi Gang, I was wondering if a generous person might be able to walk me through what I believe is a pretty simple task. I actually have significant Access experience, but I haven't done it in...
8
by: CZERNAI | last post by:
Hi Am new to programming and to this process of asking questions. I believe I have read all the threads concerning combo box questions but haven't found an answer to my problem. I am using ...
2
by: Nikolay Petrov | last post by:
I have asked a question before some time, and a guy responded to it. His answer raised new questions and I replied them back, but still no answer. I need them urgently so I am to post the whole...
4
by: Kay | last post by:
Hi all, Wondering is there a way to work with .net's combo box like in VB 6's with the ItemData property? Coz I want to store 2 values for each item in the combo.... Thanks! Kay
14
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
8
by: Jack | last post by:
Hi, I have a asp page where multiple rows for a client is generated using asp. Some of these are combo boxes and some are text and are coming from a recordset. Now, the following is the code to...
7
by: Ausclad | last post by:
Ok, ill try again..... It seems fairly simple. I have two combo boxes in a datagrid. The datagrid is bound to a a table in a dataset. The two combo boxes are bound to a single data table...
1
by: Shawn Yates | last post by:
It has been a while since I have done anything on MS Access and I seem to be a bit rusty. I hope someone could help me solve my issue. I have a form that has multiple combo boxes on it. Each box...
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...
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:
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
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?
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
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
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...

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.