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

Using Combo Box to go to a particular record

HI!

I have a form linked to a table which i use for entering and viewing data. It has a tab control in it with the first tab having the main table and other tabs having linked tables as subforms.

I want to create a combo box control which i intend to populate with values in a particular field of main table say ID field of [Main Table].
I want it to run in such a way that as select a particular value in the combo box it should show the corresponding record in the tabcontrol.

I am not very good at programming so would be grateful if it can be explained in detail.

Thanks & regards

Vijayan
May 3 '07 #1
10 7340
cyberdwarf
218 Expert 100+
Hi Vijayan
You can place your code in the AfterUpdate event of your combobox
It would look something like:-
Expand|Select|Wrap|Line Numbers
  1. Me.MainID = Me.MyCombobox
  2. Me.refresh
HTH
Steve
May 3 '07 #2
Thanks for the guidance Steve.

I did exactly as told. There were no errors. But it just did not connect properly with the table as the corresponding record was not shown.

The Code i entered was :-

Me.[Last Name] = Me.Combo35
Me.Refresh

There was another strange happening. In the [Last Name] field the value changed automatically to the Code no field of the particular record.

Help please.

Rgds

Vijayan
May 3 '07 #3
Rabbit
12,516 Expert Mod 8TB
You can use DoCmd.FindRecord. The help files will provide you with what you need for the parameters.
May 3 '07 #4
i tried it as well.
But that is also not working.

I used the following code:-

Private Sub Combo35_AfterUpdate()
Dim comboValue As Variant
comboValue = Me.Combo35.Value
DoCmd.FindRecord comboValue, acEntire, False, acSearchAll, acAll, True
Me.Refresh
End Sub

It is not working and gives an error.

I am a novice at VBA so shall be grateful if you could explain.

Regards

VIjayan
May 4 '07 #5
i used the following as well

Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo35_AfterUpdate()
  2. Dim comboValue As Variant
  3. comboValue = Me.Combo35.Value
  4. DoCmd.FindRecord comboValue, acEntire, False, acSearchAll, acAll, True
  5. Me.Refresh
  6. End Sub
  7.  
but same result - error.
pls help.
May 4 '07 #6
missinglinq
3,532 Expert 2GB
Why not simply use the Combo box wizard? I jsut posted this two minutes ago for another poster:

Create a form using the table/query as the Record Source.

Goto the Field List and drag the fields you want retrieved onto the form

Place a combo box on the form

Select "Find a record on my form based on the value I've selected..."

Next

Select the appropriate identifying field

Next

Size the Combo box column

Next

Name the combo box

Finish

Now the user can use the dropdown arrow of the combo box to retrieve the dtata or simply start typing the identifying data in and the combo box will start to autocomplete the entry. When the correct entry is found hit <Enter> and the appropriaate data should be retrieved.

Good Luck!
May 4 '07 #7
hi.

Thanks forthe help.

It worked.

However I want some customisation:-

1. I make my selection based on 2 fields [Last name] & [First Name]. But after selection only the first field is showm in the combo box. Can't it be tweaked to show both the fields.

2. Lets suppose I want the Combo box to take values from some other table or Query.
For instance, there are some records which are "dead" records and would not be updated ever again. No point in showing the corresponding [Last Name] & [First name] values for such records. So i have a query which does not include these "dead" records and has only live records. I want my combo box to list values from this query containing live records but show detals from my original table so that they can be updated. How do i manage this?

Shall be grateful for your help.
May 12 '07 #8
PLease help.

Vijayan
May 18 '07 #9
HI Friends

Nedd your help

PLease

Regards
May 22 '07 #10
HI

Please help me

Do not be so inconsiderate.

Regards
May 25 '07 #11

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

Similar topics

4
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...
0
by: CSDunn | last post by:
Hello, In Access ADP's that connect to SQL Server databases, any time I have a situation where I have a combo box in a main form that looks up a record in a subform, the subform record source has...
3
by: anita | last post by:
Hi All Can anybody pls help me out with this problem. I have a combo box control which has about 10,000 values in it. These values in the combo box are called from a different table. When i use...
3
by: Mindy | last post by:
Does anyone know the difference between Navigational and Lookup features of combo boxes? I wondered if there were difference between these two if we selecte "remember the value for later use" when...
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...
7
by: Erich Kohl | last post by:
Okay, here's the deal: Let's say a form is based on a table. This form has Field1 (PrimeKey), Field2, Field3, etc. This form also has a subform which shows related records in another table....
2
by: dancole42 | last post by:
So I have a subform that lists the various items on a particular invoice. First, the user selects a product class from the Class dropdown. This is bound to the Class field in the InvioceLines...
6
by: banderson | last post by:
Hello, I have a form and a combo box that I use to filter the form to particular records. I also have an "add new" button that, when clicked, adds a new record. My problem is that the filter combo...
6
by: dougmeece | last post by:
Hello, I have a form that I would like to auto-populate text boxes in based on the selection made from a combo box. I have set the form record source to a table "SubmittedTo" which contains 3...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.