|
-
May 17th, 2005, 11:14 PM
#1
Access 2 fields in data control
I have a form in VB6 which includes the following controls:
DBCombo - to display the AcctDescription
Textbox2 - to accept the VOLUME transacted
Textbox5 - to accept the computation for AMOUNT DUE with the formula:
VOLUME X AccRate depending on the AcctDesc chosen in the
DBCombo
These controls are linked to fields in dtaUnload which is the Data Source.
The DBCombo has AcctDesc as ListField and AcctCode as BoundColumn. Its Row source is dtaRates which is a data control tied up with the TrRates Access table whose fields are:
AcctCode AcctDesc AcctRate
A0001 Account1 2.00
A0002 Account2 2.50
A0003 Account3 3.00
How do I access the AcctRate in the data control named dtarates which is not entered by the user but is included as a field in TrRates so I can use it in the Amount Due computation to de displayed on screen?
I'm a newbie. Please do help. Thanx
-
May 19th, 2005, 10:29 AM
#2
Re: Access 2 fields in data control
Hi Pinky,
I think you just need to access the Data Controls Recordset property, whenyou select the account on the combo the datacontrol should move to that record in the recordset so Something like;
Code:
Textbox5.Text = Val(Textbox2.text) * dtaRates.Recordset.Fields("AcctRate")
should sort it ...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|