Sub Form Record Select

G

Guest

I have a sub form filtered by a couple combo boxes.
I want to be able to click on a Record in the sub form and have it display
detailed information about that record.

1) What type of event would [clicking on a record] be?

If there isn't an event, I could have a button like, "get detailed info" to
click after you select the record.

2) how do I pull that record in VB?

for example... intValue =
Me![subform]![FieldInSubForm]![ValueOfThatFieldBasedOnSelectedRecord]

I would REALLY appreciate any help.
Thanks~
 
R

ruralguy via AccessMonster.com

Assuming your SubForm is a Continuous Form then [clicking on a record] in the
SubForm other than the currently selected record will fire the CurrentEvent
of the SubForm. I would put a CommandButton on the SubForm to open the
"detailed info" form. Using the Current event will drive you nuts quickly.
I have a sub form filtered by a couple combo boxes.
I want to be able to click on a Record in the sub form and have it display
detailed information about that record.

1) What type of event would [clicking on a record] be?

If there isn't an event, I could have a button like, "get detailed info" to
click after you select the record.

2) how do I pull that record in VB?

for example... intValue =
Me![subform]![FieldInSubForm]![ValueOfThatFieldBasedOnSelectedRecord]

I would REALLY appreciate any help.
Thanks~
 
G

Guest

Thanks,

I guess that just leaves--

is there some way to identify which Record is selected?
like if someone were to click the 10th record in the list,

and say the values for columns A, B & C were BS, AL, 1FB for that record

is there any way I can pull those 3 values when an event occurs?

Thanks~

ruralguy via AccessMonster.com said:
Assuming your SubForm is a Continuous Form then [clicking on a record] in the
SubForm other than the currently selected record will fire the CurrentEvent
of the SubForm. I would put a CommandButton on the SubForm to open the
"detailed info" form. Using the Current event will drive you nuts quickly.
I have a sub form filtered by a couple combo boxes.
I want to be able to click on a Record in the sub form and have it display
detailed information about that record.

1) What type of event would [clicking on a record] be?

If there isn't an event, I could have a button like, "get detailed info" to
click after you select the record.

2) how do I pull that record in VB?

for example... intValue =
Me![subform]![FieldInSubForm]![ValueOfThatFieldBasedOnSelectedRecord]

I would REALLY appreciate any help.
Thanks~

--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
 
R

ruralguy via AccessMonster.com

*All* of the fields for the current record are available just by accessing
them either directly or by referencing a control that is bound to them. As I
said, moving the focus to any record in a continuous form makes *that* record
the current record.
Thanks,

I guess that just leaves--

is there some way to identify which Record is selected?
like if someone were to click the 10th record in the list,

and say the values for columns A, B & C were BS, AL, 1FB for that record

is there any way I can pull those 3 values when an event occurs?

Thanks~
Assuming your SubForm is a Continuous Form then [clicking on a record] in the
SubForm other than the currently selected record will fire the CurrentEvent
[quoted text clipped - 17 lines]
 
G

Guest

Sorry for going around in circles-- i'm very new to Access.

So, when you click on a record in the subform, it becomes the [focused on
record] or the [current record] inside the subform.

So how do I transfer that [current record]'s 1st field value to a text box
in the main form.

Something like,

Me!Text10.Text = Me![Subform]![CurrentRecord]![ColumnA].Text ?

I just can't figure out how to reference it =(

~

ruralguy via AccessMonster.com said:
*All* of the fields for the current record are available just by accessing
them either directly or by referencing a control that is bound to them. As I
said, moving the focus to any record in a continuous form makes *that* record
the current record.
Thanks,

I guess that just leaves--

is there some way to identify which Record is selected?
like if someone were to click the 10th record in the list,

and say the values for columns A, B & C were BS, AL, 1FB for that record

is there any way I can pull those 3 values when an event occurs?

Thanks~
Assuming your SubForm is a Continuous Form then [clicking on a record] in the
SubForm other than the currently selected record will fire the CurrentEvent
[quoted text clipped - 17 lines]
I would REALLY appreciate any help.
Thanks~
 
S

Steve

First, in your subform, turn on Record Selectors in Properties - Format.
Gray buttons will be displayed at the left of each record in the subform.
The subform's click event will fire when you click on any of these buttons.

Second, put the following code in the subform's click event:
DoCmd.OpenForm "NameOfDetailedInformationForm", , ,"[DetailID] =
Forms!MyForm!MySubformControlName!DetailID"

The above assumes the recordsource of your subform has a primary key named
"DetailID".

MyForm is the name of your main form.
MySubformControlName is the name of the subform control on the main form.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
R

ruralguy via AccessMonster.com

Post back if this link does not help.
http://www.mvps.org/access/forms/frm0031.htm
Sorry for going around in circles-- i'm very new to Access.

So, when you click on a record in the subform, it becomes the [focused on
record] or the [current record] inside the subform.

So how do I transfer that [current record]'s 1st field value to a text box
in the main form.

Something like,

Me!Text10.Text = Me![Subform]![CurrentRecord]![ColumnA].Text ?

I just can't figure out how to reference it =(

~
*All* of the fields for the current record are available just by accessing
them either directly or by referencing a control that is bound to them. As I
[quoted text clipped - 19 lines]
 
G

Guest

OMG I feel so dumb :)

Sorry Steve + ruralguy.

For some reason I thought referencing a field name like DetailID would
return all the values in that field-- not the one selected in the subform.

Thanks for all your help.



Steve said:
First, in your subform, turn on Record Selectors in Properties - Format.
Gray buttons will be displayed at the left of each record in the subform.
The subform's click event will fire when you click on any of these buttons.

Second, put the following code in the subform's click event:
DoCmd.OpenForm "NameOfDetailedInformationForm", , ,"[DetailID] =
Forms!MyForm!MySubformControlName!DetailID"

The above assumes the recordsource of your subform has a primary key named
"DetailID".

MyForm is the name of your main form.
MySubformControlName is the name of the subform control on the main form.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)





Kaseano said:
I have a sub form filtered by a couple combo boxes.
I want to be able to click on a Record in the sub form and have it display
detailed information about that record.

1) What type of event would [clicking on a record] be?

If there isn't an event, I could have a button like, "get detailed info"
to
click after you select the record.

2) how do I pull that record in VB?

for example... intValue =
Me![subform]![FieldInSubForm]![ValueOfThatFieldBasedOnSelectedRecord]

I would REALLY appreciate any help.
Thanks~
 
R

ruralguy via AccessMonster.com

It's great when the light bulb finally lights up, isn't it? Thanks for
posting back.
OMG I feel so dumb :)

Sorry Steve + ruralguy.

For some reason I thought referencing a field name like DetailID would
return all the values in that field-- not the one selected in the subform.

Thanks for all your help.
First, in your subform, turn on Record Selectors in Properties - Format.
Gray buttons will be displayed at the left of each record in the subform.
[quoted text clipped - 32 lines]
 

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