Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 12th, 2005, 10:14 AM
Registered User
 
Join Date: Jul 2005
Location: Lincoln, Lincs, United Kingdom.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multi column combo lists

As a new comer to VBA programming please, can any one point me in the right direction, I am using a combo box to allow changes to the linking of two tables the the main key in the combo being bound to a key in the matching table, My question is ? Can values from other column's in the combo list be inserted/bound to other field in the same record. the reason for this I would like to use some of the values at a later date as links between forms, where adding the table into the form query makes data entry not possible. Thank you for any help Colin . To elaborate:-
 In a project (an inventory of items). I am using a front end rear end method to connect multiple databases, the front end database having of course all the forms /reports the rear end has one holding data the remainder basically hold a key field & a thumbnail photo's of each item (for security)(in access 2002 each db limited to 2GB).
 On one of my forms (frm1)using table(A)I have a button, the VBA of which uses a CASE method to select which database & its specific input form (frm2)using Table(B)to open my item's are grouped AA , AB etc each being assigned to a specific database to store the graphics the varible number used by CASE being created in the form query using an IF ie AA =101 BA = 201 this method is limited how many variables it allows to be created.
 Thus restricting the number of attached database that can be accessed. I thought I could solve this by using two tables the one (C)that hold two fields, the lookup values AA, BA, BC,& an autokey bound to table (A)) and a second table (D)hold two fields one holds the autokey bound to table (C)the second the values 101 201 etc these being selected from a combo list by the user to assign which database (table B)they want the graphics stored,
 These two table (C,D)then can be included in (frm1)query of Table(A)+(C) +(D) thus giving me a bound field on the form (frm1)that supplies the CASE variable as my first method, using the IF exspression. to select (frm2)but when I added the third table(D) to my form (frm1)query is gave me the variable but made the form (frm1)read only, data could not be edited or added. although with a query of (A)+(C) works ok.
 Therefor I thought if I can bind/insert/autopaste another field from table(D)into table (C)make this table have three fields or is there another way I can declare the CASE 101, CASE 201 variables or do I forget the whole thing & try again,
Reply With Quote
  #2 (permalink)  
Old July 13th, 2005, 10:57 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I am not sure I understand what you want to do.

Do you want more columns of meaningful data to show up in the combo box? Do you want all the fields in a record to be linked using the FK? (This already happens.)

Can you explain more?


mmcdonal
Reply With Quote
  #3 (permalink)  
Old July 19th, 2005, 12:30 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

When you have a multi-column combobox, you can refer to all columns in selected item as such

Example: Combobox called cboChoice with four colummns

Me.cboChoice.Column(0,0) is the first column
Me.cboChoice.Column(1,0) is the second column
Me.cboChoice.Column(2,0) is the third column
Me.cboChoice.Column(3,0) is the fourth column


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #4 (permalink)  
Old July 21st, 2005, 04:57 AM
Registered User
 
Join Date: Jul 2005
Location: Lincoln, Lincs, United Kingdom.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Greg for your advice, I have used your info & created a text box on my form with the source as " =Me.cbomylink.Column(1,0)" & a value is shown smashing, but is it possible automatically to insert/save that value to the records table when you move to another record, the same as the column(2)that is already bound to the combo "second table" so that I can use the value at a later stage if required, without actually linking the tables. your help appreciated.
Thanks again Colin
Reply With Quote
  #5 (permalink)  
Old July 21st, 2005, 09:21 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

You can set the Bound Column property of that combobox to the second column so that when you move to a new record, the second column value is stored. Open the form in design view, click on the combobox and choose, say, 2 for the bound column. Unlike the indexing of the columns, e.g. 0 to 3, the bound column property actually starts at 1, i.e. 1 to 4. So if you want the second column to be bound, enter 2.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi Column Combo Box in Datagrid View Columns HemaChaudhry Visual Basic 2005 Basics 1 September 20th, 2007 07:51 AM
Multi-column combo box in datagridview aad1 C# 0 June 5th, 2006 09:58 AM
VS 2005 Beta 2 - DataGridView multi-column combo thespiritual1 .NET Framework 2.0 0 June 24th, 2005 07:43 AM
multi-column combo myth12345 VB How-To 1 January 3rd, 2005 04:29 PM
Multi-Column Combo Boxes twsinc Access 1 September 22nd, 2004 12:14 PM



All times are GMT -4. The time now is 11:48 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.