By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,824 Members | 2,410 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,824 IT Pros & Developers. It's quick & easy.

Fill one control based on content of second control/Retrieve records with combobox

P: 21
Hi there I'm trying to do two things using Access 2000 hopefully someone can help me with it.

1. Using Access Forms if i enter a number in a textboxfield (Named "A") that in another textbox field it will automatically load for example a piece of text which says BETA in field (Named "B")

2. Using Access Forms, What VB Code could I use that will load the first colum of a table (The Primary Key for this example) in a drop down menu, when I click on it it will load up the record with other information on it. Instead of using the (Next, Previous and Find) Buttons.

Hopefully this makes sense.
Dec 18 '07 #1
Share this Question
Share on Google+
3 Replies


missinglinq
Expert 2.5K+
P: 3,532
1. Using Access Forms if i enter a number in a textboxfield (Named "A") that in another textbox field it will automatically load for example a piece of text which says BETA in field (Named "B")

Expand|Select|Wrap|Line Numbers
  1. Private Sub A_AfterUpdate()
  2. Select Case A
  3.   Case 1
  4.   Me.B = "Alpha"
  5.  
  6.   Case 2
  7.   Me.B = "Beta"
  8.  
  9. End Select
  10.  
  11. End Sub
  12.  
2. Using Access Forms, What VB Code could I use that will load the first colum of a table (The Primary Key for this example) in a drop down menu, when I click on it it will load up the record with other information on it. Instead of using the (Next, Previous and Find) Buttons

Add a combo box to your form. The Combobox Wizard will pop up

Select "Find a record based on the value I selected in my combobox."

From the query/table the form is based on, click on the field you're searching by (your PK field) to move it to the right side.

Hit Next.

Size the column appropriately.

Hit Next.

Name the combobox.

Hit Finish.

Now you can drop the combobox down and scroll down to the item to search by, or you can start to enter the item, and the combobox will "autofill" as you type. Hit <Enter> and the record will be retrieved.

Welome to TheScripts!

Linq ;0)>
Dec 19 '07 #2

P: 21
Thanks worked like a charm. Just preparing for the next part of my script :)
Dec 22 '07 #3

missinglinq
Expert 2.5K+
P: 3,532
Glad we could help!

Linq ;0)>
Dec 22 '07 #4

Post your reply

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