John
The Outer Form Contains 1 combobox(Billno),1 combobox with 2 columns(CustomerName,CustomerType)
The subform(Datasheet) contains 1 combobox(partcode),Textbox(Qty),Textbox(SalePrice),BillNo(hidden)
There are 2 saleprice depending on the customertype
BillNo is the link master and link child
Now when afterupdate the partcode combobox it is OK i fill the saleprice field with right saleprice by looking to the customertype in the outer form but if the user after he filled the subform he found that it was wrong customername and he want to correct it ,So afterupdate the customername in the outerform i have to correct the saleprice in the subform so i have to loop through all records in the subform
so i made the code
With Forms!TransMain!TransSub.form.Recordsetclone
Do Until .EOF
.Edit
.SalePrice=.PartCode.Column(3)
.Update
.MoveNext
Loop
.Close
End with
But it does not work(can not read the .PartCode.Column(3)
I hope this is clear
Ahmed
________________________________
From: John Viescas <john@viescas.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Wednesday, February 1, 2012 8:20 PM
Subject: RE: [MS_AccessPros] Combobox column value
Ahmed-
What is the Record Source of the outer form?
What is the Record Source of the subform?
What are the Link Master / Link Child properties of the subform control?
What is the Row Source of the combo box?
I need answers to all those questions (including the SQL of the queries) to be able to give you the best answer.
John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Lahaina, HI)
-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of ahmad beshari
Sent: Wednesday, February 01, 2012 4:53 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Combobox column value
John
What i mean is that i want to loop through the subform recordset and find the 3rd column value
Ahmed
________________________________
From: John Viescas <john@viescas.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Tuesday, January 31, 2012 10:50 PM
Subject: RE: [MS_AccessPros] Combobox column value
Ahmed-
The expression in VBA to get the third column of a combo box on a subform in
code behind the main form is:
Me.NameOfSubformControl.Form!NameOfComboBox.Column(2)
John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Lahaina, HI)
-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of ahmad beshari
Sent: Tuesday, January 31, 2012 10:31 AM
To: ms_access_professionals@yahoogroups.com
Subject: [MS_AccessPros] Combobox column value
Dears
I have a form with subform, a Combobox with 3 columns is one of the subform
controls .By clicking a Buttom in the main form i like to read the
value for the third column in the combobox Is there any way to do this?
thanks
Ahmed
------------------------------------
Yahoo! Groups Links
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
[Non-text portions of this message have been removed]
Kamis, 02 Februari 2012
Re: [MS_AccessPros] Combobox column value
__._,_.___
.
__,_._,___
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar