I can't believe I can't Figure this out.

R

RonnieK

This has to be very simple... but...
I have a form that displays records in a list box based on a check box = Yes.
So I have about 10 or so records showing in the list box. When I click on
one of the records, it should open a new form to display more details of the
selected record. The problem is that it always displays the first record in
the table.

I have a macro that displays the detailed record from the list box (after I
pick from the list box), but I can't seem to figure out how to make the macro
display the record I clicked on. The macro is simple:

OpenForm (which opens the form to display the details of the
record)
FindRecord.

In the "FindRecord" I put "ID" as the "Find What" in the arguments pane.
"ID" is the primary key field in the
master file record I'm trying to select.

Any help will be greatly appreciated.
Ronnie Keith
 
G

Guest

Hi RonnieK,

Why not set the recordsource of the form you are opening to select records
that match the item you selected in the listbox eg:

select * from TABLE where FIELDID = forms!FORMNAME.LISTBOX

Hopt that helps.

Damian.
 
R

RonnieK via AccessMonster.com

Damian, Thanks

I apparently can't figure out the syntax for this.

My table name is "Client Master File" (Where the detail data comes from)

My list box form is "Processing - Select Clients". (This is the form that
contains the list box "Processing Client List").

My List Box Name (In the "Processing - Select Clients" Form) is "Processing
Client List" (This is the list box in the first form that I select the record
I want to use in the "Processing Detail" form).

The form that I'm trying to get the information to show in is "Processing
Detail"

ID is the primary key (auto number).
This is a "flat file" I'm only using one table for this.

Here's what it looks to me like I should enter into the "recordsource" for
the form "Processing Detail"

select * from Client Master File where ID = forms!Processing - Select Client.
Processing Client List

But I get errors.

Again, I really appreciate any help you can give me.
Why not set the recordsource of the form you are opening to select records
that match the item you selected in the listbox eg:

select * from TABLE where FIELDID = forms!FORMNAME.LISTBOX

Hopt that helps.

Damian.
This has to be very simple... but...
I have a form that displays records in a list box based on a check box = Yes.
[quoted text clipped - 17 lines]
Any help will be greatly appreciated.
Ronnie Keith
 
G

Guest

PMFJI,

The problem is that you used spaces and special characters when you named
your objects. As you have found, spaces in names of objects causes you
headaches.

Since you have spaces in the names, you need to enclose them in brackets:

Try this:

Sselect * from [Client Master File] Where [ID] = forms![Processing - Select
Client].
[Processing Client List]


If you must separate words, use the underscore Client_Master_File

This is another way (no spaces) >> ClientMasterFile

Also, search the web for "naming conventions". Here is one page:

http://www.mvps.org/access/general/gen0012.htm

A consistant nameing convention makes it easierto tell what the object is

if the object is then the prefix is

table ............ tbl
form..............frm
listbox............lb (lower case L )

So the recordsource would look like:
(should be one line)

Sselect * from tblClientMasterFile where [ID] =
forms!frmProcessingSelectClient.lbProcessingClientList

Just remember - if you use spaces in object names, enclose them in brackets :)


BTW, form "Processing - Select Clients" must bo open when you open form
"Processing Detail".



HTH
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


RonnieK via AccessMonster.com said:
Damian, Thanks

I apparently can't figure out the syntax for this.

My table name is "Client Master File" (Where the detail data comes from)

My list box form is "Processing - Select Clients". (This is the form that
contains the list box "Processing Client List").

My List Box Name (In the "Processing - Select Clients" Form) is "Processing
Client List" (This is the list box in the first form that I select the record
I want to use in the "Processing Detail" form).

The form that I'm trying to get the information to show in is "Processing
Detail"

ID is the primary key (auto number).
This is a "flat file" I'm only using one table for this.

Here's what it looks to me like I should enter into the "recordsource" for
the form "Processing Detail"

select * from Client Master File where ID = forms!Processing - Select Client.
Processing Client List

But I get errors.

Again, I really appreciate any help you can give me.
Why not set the recordsource of the form you are opening to select records
that match the item you selected in the listbox eg:

select * from TABLE where FIELDID = forms!FORMNAME.LISTBOX

Hopt that helps.

Damian.
This has to be very simple... but...
I have a form that displays records in a list box based on a check box = Yes.
[quoted text clipped - 17 lines]
Any help will be greatly appreciated.
Ronnie Keith
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top