Please explain this query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

DoCmd.OpenForm "frmAddresses", acNormal, "", "[CompanyName]=[Forms]![frmInquiry]![tblLink].[Form]![CompanyName]", , acNorma

Please explain the Where part of the cod
[CompanyName]=[Forms]![frmInquiry]![tblLink].[Form]![CompanyName

THanks
 
The form is being opened in a filtered state. It will only show records
where the Company Name is the same as the company name located in a control
on the subform of the form frmInquiry.

--
Wayne Morgan
Microsoft Access MVP


augustus108 said:
DoCmd.OpenForm "frmAddresses", acNormal, "",
"[CompanyName]=[Forms]![frmInquiry]![tblLink].[Form]![CompanyName]", ,
acNormal
Please explain the Where part of the code
[CompanyName]=[Forms]![frmInquiry]![tblLink].[Form]![CompanyName]

THanks
 
It's referencing a control called CompanyName on a subform
whose main form is frmInquiry. tblLink is the name of the subform container
that's on frmInquiry.
 
Is there a way to force an update on a subform

Currently, the main form A contain a button that will open a form B (linked to table B)(say, allowing me to input client detail), and a subform C which contain a combobox that allow me to select the client name and phone no. (reflect infomation in table B)

But so, the subform rarely get updated immediately after I made a new input in form B
I need to physical leave form A, and open from A again before subform C get an update

Why? ANd how could I change this behaviour
 
After you make the addition, you need to Requery the subform. Using the
syntax you gave to the subform

[Forms]![frmInquiry]![tblLink].[Form]![CompanyName]

to requery this subform in code, try

Forms!frmInquiry!tblLink.Form.Requery

--
Wayne Morgan
MS Access MVP


augustus108 said:
Is there a way to force an update on a subform?

Currently, the main form A contain a button that will open a form B
(linked to table B)(say, allowing me to input client detail), and a subform
C which contain a combobox that allow me to select the client name and phone
no. (reflect infomation in table B).
 
Back
Top