473,503 Members | 2,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I go to another record in a form by using combo box

1 New Member
I have a form with a combo box that I want to use for navigating through the records. I have 10 records (for test purposes) in my table (mainly text boxes, but also a check box and an ole object for pictures). When navigating through the records by using page down or the default record navigator everything in the form change according to what I have entered into the table (Table_Person).

Instead I want to use a combo box to navigate the records. First names (Col_First_Name) are displayed in the combo box. I don't allow first name dublicates even though the primary key is the Col_ID.

So what I am trying to accomplish here is to go to the record associated with the first name that I choose in the combo box. Of course everything else in the form must change as well (txt boxes, check boxes, images etc.)

How can I achieve this?
Mar 14 '07 #1
2 1354
dima69
181 Recognized Expert New Member
I have a form with a combo box that I want to use for navigating through the records. I have 10 records (for test purposes) in my table (mainly text boxes, but also a check box and an ole object for pictures). When navigating through the records by using page down or the default record navigator everything in the form change according to what I have entered into the table (Table_Person).

Instead I want to use a combo box to navigate the records. First names (Col_First_Name) are displayed in the combo box. I don't allow first name dublicates even though the primary key is the Col_ID.

So what I am trying to accomplish here is to go to the record associated with the first name that I choose in the combo box. Of course everything else in the form must change as well (txt boxes, check boxes, images etc.)

How can I achieve this?
Something like this :

Expand|Select|Wrap|Line Numbers
  1. Private Sub MyCombo_AfterUpdate()
  2. Dim rs As Recordset
  3. If Me![Col_ID] <> Me![MyCombo] Then
  4.     Set rs = Me.RecordsetClone
  5.     rs.FindFirst "Col_ID = " & Me![MyCombo]
  6.     If Not rs.NoMatch Then
  7.         Me.Bookmark = rs.Bookmark
  8.     End If
  9. End If
  10. End Sub
Mar 17 '07 #2
missinglinq
3,532 Recognized Expert Specialist
Or if VBA code seems intimidating to you, let Access do the work and simply use the combo box wizard. Place a combo box on the form, and when the wizard comes up select the third option "Find a record on my form based on the value I selected in my combo box."

Click Next, then under Available Fields select Col_First_Name
Mar 17 '07 #3

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

Similar topics

2
3183
by: Tony Williams | last post by:
I have two tables one lists the names of committees and the other is a list of documents they generate. I have a form based on the documents table which gives details of the document including...
4
4725
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record...
6
3397
by: Robin S. | last post by:
Originally I wanted a list box which selects which record is the current one within the same form. Easy enough until Access takes a dump when one is deleted and then someone tries to select it in...
2
9444
by: kmnotes04 | last post by:
Is it possible to link one drop-down box to another? For example, if a name is chosen from a drop-down list, can another drop-down list then automatically display the person's office as a result of...
6
2729
by: AA Arens | last post by:
Hi, I have a database with 2 main forms. Contacts and companies. I share the base with two others via LAN. On the companies form I have buttons to navigate throught the records (>400). We are...
4
1300
by: keri | last post by:
I have got myself into a total muddle over this and not sure where to turn. I have 2 tables; Customers - which has a primary key of customerID Appointments - which has a primary key of AppID ...
2
4095
by: AA Arens | last post by:
I have a form with a combo account manager (choose the name) I have record navigation buttons on that form, along with other fields. I do not use queries, only tables. One of the tables is the...
2
1507
by: rankbgnr | last post by:
Hi I'm sorry for the basic questions but I'm beginner. I have some programming experience but from long ago and with different languages. I do understand relational databases but not object...
4
1595
kcdoell
by: kcdoell | last post by:
I have a form (Form1) that displays records based on 3 unbound combo boxes that are also on my form. My record source for this form is a query “ReQryForecast” (which looks at those combo boxes via...
0
7188
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7063
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
7313
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...
1
6970
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...
1
4987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1489
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.