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

sync two boxes

158 100+
I have two drop down boxes. Both pull from the same table (tblItemMaster). What i need it to do is when the user selects an item from the item dropdown box (ie bolts, screws etc) i need the description box to automatically display that description in the description drop down box. The only part that is working is "lookup" drop down box for parts.

Any help is greatly appreciated!!

Thanks!
Aug 21 '08 #1
5 1723
puppydogbuddy
1,923 Expert 1GB
I have two drop down boxes. Both pull from the same table (tblItemMaster). What i need it to do is when the user selects an item from the item dropdown box (ie bolts, screws etc) i need the description box to automatically display that description in the description drop down box. The only part that is working is "lookup" drop down box for parts.

Any help is greatly appreciated!!

Thanks!
1. Change your second dropdown box to a textbox. You don't need another lookup box for description because it is (should be) one of the columns in your first lookup box and just needs to be retrieved.
2. Place the following code in the combobox's AfterUpdate event as shown:

Expand|Select|Wrap|Line Numbers
  1. Private Sub YourCombo_AfterUpdate()
  2.  
  3. Me!YourTextbox.Value = Me!YourCombobox.Column(1)
  4.  
  5. End Sub

You need to replace the illustrative names (YourTextbox, YourCombobox) I used with the real names in your application. Column indexes start at 0...hence the reference to column(1)...I am assuming the description is in the second column of your combobox Column 1 is the second column.....0,1......
Aug 21 '08 #2
Jollywg
158 100+
1. Change your second dropdown box to a textbox. You don't need another lookup box for description because it is (should be) one of the columns in your first lookup box and just needs to be retrieved.
2. Place the following code in the combobox's AfterUpdate event as shown:

Expand|Select|Wrap|Line Numbers
  1. Private Sub YourCombo_AfterUpdate()
  2.  
  3. Me!YourTextbox.Value = Me!YourCombobox.Column(1)
  4.  
  5. End Sub

You need to replace the illustrative names (YourTextbox, YourCombobox) I used with the real names in your application. Column indexes start at 0...hence the reference to column(1)...I am assuming the description is in the second column of your combobox Column 1 is the second column.....0,1......

That is almost exactly what i need. The only problem is that whenever i put in the item the description comes up (as it should). Then when i move to the next record which appears right below it (this is a subform) the item can be changed, but all the descriptions change with it.[/IMG]
Attached Images
File Type: jpg example.JPG (53.7 KB, 144 views)
Aug 21 '08 #3
missinglinq
3,532 Expert 2GB
You don't have your description textbox bound to a field in the underlying table, and this is the normal behavior for unbound controls on continuous/datasheet forms. You'll have to have a field in the table for Description and enter it in the textbox's Control Source Property.

Linq ;0)>
Aug 21 '08 #4
Jollywg
158 100+
You don't have your description textbox bound to a field in the underlying table, and this is the normal behavior for unbound controls on continuous/datasheet forms. You'll have to have a field in the table for Description and enter it in the textbox's Control Source Property.

Linq ;0)>

Now in addition to updating the description i need to update the price. it is the 3rd column in the table, and i used the same line of code with the exception that i changed the (1) to a (2). It doesn't give me an error, but it doesn't display anything either.
Aug 22 '08 #5
puppydogbuddy
1,923 Expert 1GB
Now in addition to updating the description i need to update the price. it is the 3rd column in the table, and i used the same line of code with the exception that i changed the (1) to a (2). It doesn't give me an error, but it doesn't display anything either.
In order to reference the price as Column(2) in your combobox, it must be included as the third column in the combobox's row source table/query and must have a column width > 0 that fits in relation to the total width displayed for the combobox.
Aug 23 '08 #6

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

Similar topics

1
by: kartik | last post by:
I open an fstream in read-only mode, read till the end, then try to sync() before seeking to position 0 & reading again. But the sync fails. I discovered that clear()ing the stream before the sync...
0
by: JG | last post by:
What are the implications of setting the "--bdb-no-sync" flag when using the BDB storage engine. There isn't alot of documentation on this. I have searched google and docs. If there is a...
3
by: Ryan Liu | last post by:
Hi, What does ArrayList.Synchronized really do for an ArrayList? Is that equal to add lock(this) for all its public methods and properties? Not just for Add()/Insert()/Remvoe()/Count, but also...
7
by: Ole | last post by:
Hi, I'm going to develop a socket communication between an instrument (running CE 5.0 with Compact Fraework V2) and a PC. As the instrument should only connect to one PC at a time I believe that...
1
by: =?Utf-8?B?UmVkYmFjaw==?= | last post by:
Hi All, slight problem I hope someone could shed some light on. I am using VS 2005. In a datagridview I have 2 comboboxes that are both bound to a table field called "empCode". This is an...
3
by: iKiLL | last post by:
Hi , I am trying to debug a problem with a Windows Mobile Application. I need the PDA to Sync(I have writen the sync process myself using a web service) using GPRS while Debugging from the VS...
7
by: john | last post by:
I am reading TC++PL3 and on page 644 it is mentioned: "Flushing an istream is done using sync(). This cannot always be done right. For some kinds of streams, we would have to reread characters...
2
by: Jorge | last post by:
Either a synchronous call isn't what I believe it to be, or there's a bug in FF3 : IOW : Why does the onclick handler of the button "SYNC" return (in FF3) before the XHR has completed ? Click...
3
by: OldBirdman | last post by:
Help & Support - Start syncing 1. Click to open Sync Center - OK I did that 2. On the toolbar, click Sync All - There is NO toolbar So under Tasks, I click "Set up new sync partnerships". ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.