If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to reach through subform to underlying table?
With VBA I've learned to pull data from fields on my subform like this:
sbfVendorDetail.Form.[Start Date]. However, fields such as the ID may not be on the subform since the user doesn't need to see it and it would take up space. Is there a way to read the ID field of the current record of the subform without putting the field on the form? |
#2
|
|||
|
|||
How to reach through subform to underlying table?
"WDSnews" wrote in message
... With VBA I've learned to pull data from fields on my subform like this: sbfVendorDetail.Form.[Start Date]. However, fields such as the ID may not be on the subform since the user doesn't need to see it and it would take up space. Is there a way to read the ID field of the current record of the subform without putting the field on the form? If the field is in the form's (subform's) recordset -- that is, included in whatever set of fields are selected by the form's recordsource query -- then you can access it the exact same way: Me.sbfVendorDetail.Form.[ID] In some circumstances you may find that you need to prefix the field name with a bang (!) instead of a dot (.), like this: Me.sbfVendorDetail.Form![ID] If the field is not in the form's recordset, though, you can't do that. -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
#3
|
|||
|
|||
How to reach through subform to underlying table?
The easiest method is to put it on the form or subform and set its Visible
Property to False. Then you can call it the same way. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access "WDSnews" wrote in message ... With VBA I've learned to pull data from fields on my subform like this: sbfVendorDetail.Form.[Start Date]. However, fields such as the ID may not be on the subform since the user doesn't need to see it and it would take up space. Is there a way to read the ID field of the current record of the subform without putting the field on the form? |
Thread Tools | |
Display Modes | |
|
|