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

refering to control on subform

P: n/a
I have a sub form in datasheet view on a form.
I want a query to find the recordid every time a different row on the datasheet
has the focus.
The query is grabbing data for a combo on a second sub form.

Any thoughts ?
TIA
David B
Hexham UK

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

On your first subform, when in design mode, add a textbox control, and bound
it to ID field. Call it txtID
It won't be visible in datasheet mode, but it will be available from code

On main form, add another textbox, call it again txtID, make it hidden (set
Visible to false), and using ellipsis button from the right of the
ControlSource property, select Forms -> All forms -> <your subform> ->txtID
control

The control source will looks like this now

Forms![YourSubFormName]![txtID]

This way, you can get read the value of your txtID ctrl from main form which
always contains the ID of selected record in first subform.

HTH,
Bogdan Zamfir

_______________________________
Independent Consultant
"David B" <da***@marleycotenospam.fsnet.co.uk> wrote in message
news:bp**********@newsg4.svr.pol.co.uk...
I have a sub form in datasheet view on a form.
I want a query to find the recordid every time a different row on the datasheet has the focus.
The query is grabbing data for a combo on a second sub form.

Any thoughts ?
TIA
David B
Hexham UK

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.