|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello to all!
I have a form with a combo box presenting clients names & ID. In that form I placed a sub-form with the properties set to datasheet view. I need to find the syntax for changing the sub-form RecordSource from the ComboBox_AfterUpdate event. from some reason i keep getting an error saying Access cant find the sub-form. thank you for any help! |
|
#2
|
||||
|
||||
|
The syntax to refer to a subform can be quite confusing. The best way to do it is to use the Expression Builder, where you can click on the Forms collection, then Open Forms, then your Form, then your Subform, and it will build the correct syntax. You can open the Expression Builder with the toolbar icon that looks like a magic wand with fairy dust (or something!) sprinkling down from it.
__________________
Experience is the thing you have left when everything else is gone. |
|
#3
|
|||
|
|||
|
Here is an example from my project that shows referencing subform RecordSource property in VBA code from the parent form:
Code:
Me.ctrSampleList.Form.RecordSource = "SELECT Submit.*, StateNum, ProjectName, ProgCode, LedgerCode, Colo, FedNum, Metric, Remark1, Remark2, Remark3, Remark4, Remark5, Remark6 " & _ "FROM ((Submit LEFT JOIN Projects ON Submit.ProjRecID = Projects.ProjRecID) LEFT JOIN Remarks ON Submit.LabNum = Remarks.LabNum) ORDER BY Submit.LabNum DESC" Me.ctrSampleList.Form.Requery Code:
=IIf([Forms]![DataSoilsAgg]![tbxSet] Like "1*",IIf(nz([Forms]![DataSoilsAgg]![ctr1]![tbxLabOneHalf],100)=100,Null,IIf([SScond]="BA" Or [SScond]="CA",100-[Forms]![DataSoilsAgg]![ctr1]![tbxLabOneHalf])),Null) Code:
[Form_Transfer].tbxNewDate = Me.tbxDate Last edited by June7 : July 3rd, 2009 at 10:32 PM. |
|
#4
|
|||
|
|||
|
thanks!
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Forms - Changing a sub form's RecordSource |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|