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

Find Record - Choices appear in Combobox

P: n/a
I am creating a database of documents that need to be worked on, are int eh proress of being worked on, and have been completed. Sometimes the same document (an updated version) comes back for more work. I am keeping all the info in one table and using an Index numberas my Primary Key. I have a form based on this table with a Findrecord button (used the Command Button Wizard for this) that populates the form when it finds the particular record.
However, if the search turns up multiple records, I would like the field where multiple results were found to become a combobox (from a textbox) which allows me to choose which of teh records I want (instead of using the 'find next' functionality in teh search). I need to know how to code this and also how to turn the combobox back to a locked textbox once the desired record is displayed. I was thinking that I would use the show/ hide function to appear/ disappear the text and comboboxes at the right times, but I can't get the combobox to populate with only the duplicate found info and then when I run another find, to only have the new duplicate found info in it. Can you show me how to code this and how to insert it into the event procedure that is automatically generated by the Command Button Wizard for 'Find Record'? Thanks!

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Based on what you have here, I would suggest that you create a listbox
instead, and use the listbox wizard for creating the listbox.

Darryl Kerkeslager
"Sarah Smith via AccessMonster.com" <fo***@AccessMonster.com> wrote
I am creating a database of documents that need to be worked on, are int eh proress of being worked on, and have been completed. Sometimes the same
document (an updated version) comes back for more work. I am keeping all the
info in one table and using an Index numberas my Primary Key. I have a form
based on this table with a Findrecord button (used the Command Button Wizard
for this) that populates the form when it finds the particular record. However, if the search turns up multiple records, I would like the field

where multiple results were found to become a combobox (from a textbox)
which allows me to choose which of teh records I want (instead of using the
'find next' functionality in teh search). I need to know how to code this
and also how to turn the combobox back to a locked textbox once the desired
record is displayed. I was thinking that I would use the show/ hide function
to appear/ disappear the text and comboboxes at the right times, but I can't
get the combobox to populate with only the duplicate found info and then
when I run another find, to only have the new duplicate found info in it.
Can you show me how to code this and how to insert it into the event
procedure that is automatically generated by the Command Button Wizard for
'Find Record'? Thanks!
Nov 13 '05 #2

P: n/a
I have tried that too, but I guess I don't know what choices to make in th e wizard. Do I need to create a specific query or does the temporary one run by the FindRecord command button work and then how do I link the two? Basically, can you walk me through what choices I need to make in the listbox wizard? Thanks

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #3

P: n/a
Using the listbox wizard,
1. Find a record on my form
2. Select the fields you want (select the primary key field, and 2-4 fields
you want to see to find the right record)
3. Next

Sample Code:

Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[aka_id] = " & str(Nz(Me![List8], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

Notes: I just left my listbox named with the default that came up, "List8".
aka_id is the primary key of the table that I created the listbox from. The
above code was generated automatically, in the AfterUpdate event of the
listbox.

You will want to customize the listbox, particularly Column Heads (yes),
Column Widths (adjust), and the Row Source. The Row Source can be edited
using Query Design View, available by clicking the [...].

For instance, the wizard created this SQL for the Row Source:

SELECT [aka].[aka_id], [aka].[aka_off_id], [aka].[aka_first_name] FROM [aka]

a little customization gives row headers, and sorts the listbox.

SELECT aka.aka_id, aka.aka_off_id AS [Offender ID], aka.aka_first_name AS
[First Name]
FROM aka
ORDER BY aka.aka_first_name;
Darryl Kerkeslager

"Sarah Smith via AccessMonster.com" <fo***@AccessMonster.com> wrote in
message news:2d******************************@AccessMonste r.com...
I have tried that too, but I guess I don't know what choices to make in th e wizard. Do I need to create a specific query or does the temporary one run
by the FindRecord command button work and then how do I link the two?
Basically, can you walk me through what choices I need to make in the
listbox wizard? Thanks
--
Message posted via http://www.accessmonster.com

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.