dbTalk Databases Forums  

Custom Find/search Form that sets the current record on a main form

comp.database.ms-access comp.database.ms-access


Discuss Custom Find/search Form that sets the current record on a main form in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
fred
 
Posts: n/a

Default Custom Find/search Form that sets the current record on a main form - 12-04-2003 , 09:28 PM






I'm trying to create a custom find form. I've looked at some examples
and searched the topic, but I'm still failing to get this find form
working properly.

I have a custom form displaying customers first and last names in a
List box. This form works and filters my customers properly. My
problem is that I need to be able to double click one of these records
in the search form and have it set the current record on my main form.

Can anyone provide some examples of how I might do this?

Thanks much for the help.

Reply With Quote
  #2  
Old   
Ray
 
Posts: n/a

Default Re: Custom Find/search Form that sets the current record on a main form - 12-05-2003 , 07:30 AM






fred (AT) besttechsolution (DOT) com (fred) wrote in message news:<cc913dbb.0312041928.6d6fca75 (AT) posting (DOT) google.com>...
Quote:
I'm trying to create a custom find form. I've looked at some examples
and searched the topic, but I'm still failing to get this find form
working properly.

I have a custom form displaying customers first and last names in a
List box. This form works and filters my customers properly. My
problem is that I need to be able to double click one of these records
in the search form and have it set the current record on my main form.

Can anyone provide some examples of how I might do this?

Thanks much for the help.
Hello Fred,

Perhaps what you could do is use the Wizard builder on the
tool box when selecting a new list box to put on your form.
Make the control source the same as what you currently have
in the current list box.

With the wizard builder selected in the tool box, select and
drag a new listbox onto your form. This will start the wizard.

The default selection is to look up values in a table or query,
if not selected do so. Next, select the table or query source
you need, next select the fields required. It's best to select
the Record ID first and then all of the rest needed.

Then name the control according to your needs and select finish.

That's all there is to it. If you need to edit the control source
you can always do it later. Now, run the form and make a selection.

Have a good day.

Regards,

Ray


Reply With Quote
  #3  
Old   
fred
 
Posts: n/a

Default Re: Custom Find/search Form that sets the current record on a main form - 12-05-2003 , 09:01 PM



Thanks for the response.

What I believe your describing, is a way to create a form that uses a
Query to display data in a List box. I've been able to do this. What
I need to do, is once this list box displays the various records that
match my search parameters, to double click (or click a button) and
have the current record set on my main form.

I was looking at various dblclick macro events, but none seem to set
the current record of a Form, or perhaps I'm not seeing a method to do
this.


raycait (AT) excite (DOT) com (Ray) wrote in message news:<20ba9f4a.0312050530.4235988e (AT) posting (DOT) google.com>...
Quote:
fred (AT) besttechsolution (DOT) com (fred) wrote in message news:<cc913dbb.0312041928.6d6fca75 (AT) posting (DOT) google.com>...
I'm trying to create a custom find form. I've looked at some examples
and searched the topic, but I'm still failing to get this find form
working properly.

I have a custom form displaying customers first and last names in a
List box. This form works and filters my customers properly. My
problem is that I need to be able to double click one of these records
in the search form and have it set the current record on my main form.

Can anyone provide some examples of how I might do this?

Thanks much for the help.

Hello Fred,

Perhaps what you could do is use the Wizard builder on the
tool box when selecting a new list box to put on your form.
Make the control source the same as what you currently have
in the current list box.

With the wizard builder selected in the tool box, select and
drag a new listbox onto your form. This will start the wizard.

The default selection is to look up values in a table or query,
if not selected do so. Next, select the table or query source
you need, next select the fields required. It's best to select
the Record ID first and then all of the rest needed.

Then name the control according to your needs and select finish.

That's all there is to it. If you need to edit the control source
you can always do it later. Now, run the form and make a selection.

Have a good day.

Regards,

Ray

Reply With Quote
  #4  
Old   
Scott McDaniel
 
Posts: n/a

Default Re: Custom Find/search Form that sets the current record on a main form - 12-08-2003 , 01:27 PM



Dim rst As DAO.Recordset

Set rst = NameOfYourForm.RecordsetClone

rst.FindFirst "UniqueIDField=" & Me.NameOfYourListbox.Column(0)

If Not rst.NoMatch Then
NameOfYourForm.Bookmark = rst.Bookmark
End If

Set rst = Nothing

Caveats:
1) The form you are attempting to search must be open
2) You must have a reference set to DAO
3) You must have included the unique value of the Customer record in the
Listbox

Note that this is aircode, and as such some of the syntax may be wrong. If
so, I'm sure someone will correct me <grin>

"fred" <fred (AT) besttechsolution (DOT) com> wrote

Quote:
I'm trying to create a custom find form. I've looked at some examples
and searched the topic, but I'm still failing to get this find form
working properly.

I have a custom form displaying customers first and last names in a
List box. This form works and filters my customers properly. My
problem is that I need to be able to double click one of these records
in the search form and have it set the current record on my main form.

Can anyone provide some examples of how I might do this?

Thanks much for the help.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.