refer to value in query builder

history

Egyptian Pharaoh
Local time
, 02:40
Joined
Jan 26, 2008
Messages
190
Hi Brothers,

I've a Sale Invoice form contains : Invoice No. , Invoice Date , Customer Name , Customer debts (Number) , Customer credits (Number) ,,,,,, etc.
The field Customer Name is a combo box, it's row source is query contains :
Customer Name , Amount , Status(Debt,Credit)

I need to get the data from Amount and put it in Customer debts or Customer credits according to it's status.

So I think On After Update Event of Customer Name some code can be put.

Thanks in advance
 
You could do it in the afterupdate event of a control if you like - select the value you want in the combo box, then in the after update put
Code:
customerdebt.value=comboname.column(x)
Where X is the column number starting from 0.
 
Thank for reply

but I need to get the data from Amount and put it in Customer debts or Customer credits according to it's status.
 
Try an if in the afterupdate
 
I tried

If CutomerName.Column(4)="Debt" Then
Me.Debt = CutomerName.Column(3)
Else
If CutomerName.Column(4)="Credit" Then
Me.Credit = CutomerName.Column(3)
End If
End If

but nothing occurred
 
Try debt.value instead - assuming that's the name of the control, not the field name in the underlying table.

You've also got 2 end if's there, and you've spelt customer as cutomer.... but VBA would have thrown thowe up as errors anyway I expect :)
 
Yes you're right I've some spelling mistakes ,,, but it's not in the vba

I tried the right syntax and used the "debt.value" but the same unfortunately

I'm still waiting for help
 
Hello

Thanks GOD ,, it's resolved ,,, my mistake was in the space before the text :
it should be " Debt" not "Debt"

Thanks a lot James
 

Users who are viewing this thread

Back
Top Bottom