DLOOKUP For Button

Bandara

Member
Local time
Today, 16:20
Joined
Apr 17, 2020
Messages
60
This is my DLO0KUP Query

Me.BalanceA = DLookup("Balance", "CardDetails", "CardNo='" & Me.Combo60 & "'")

When I add this to Combo Box It work and show the result in the form field. But When I Add this to my Submit button it doesn't Work?

Why is it?
 
But When I Add this to my Submit button it doesn't Work?
what do you mean add it to the submit button?

that doesn't make sense. you can't assign a formula to a button. are you talking about *throwing it* into the combo box after the button is pressed? on the other hand, your form field depends on a value being in the combo box. if you're pressing the button without a value being in the combo box, of course it's not going to work. then again, you could have the wrong syntax behind the button too.
 
what do you mean add it to the submit button?

that doesn't make sense. you can't assign a formula to a button. are you talking about *throwing it* into the combo box after the button is pressed? on the other hand, your form field depends on a value being in the combo box. if you're pressing the button without a value being in the combo box, of course it's not going to work. then again, you could have the wrong syntax behind the button too.
OK
 
Me.BalanceA = DLookup("Balance", "CardDetails", "CardNo='" & Me.Combo60 & "'")

In my form there is a Field called Called Recharge.
And Onther field for New Balance.

Can I DO addition of Balance field value in my table and form enterd recharge amount and display it on New Balance field in my form by using DLookup
 
Can I DO addition of Balance field value in my table and form enterd recharge amount and display it on New Balance field in my form by using DLookup
I haven't used access forever, but I think so. maybe something like this behind the button:

Code:
me.newBalance = DLookup("Balance", "CardDetails", "CardNo='" & Me.Combo60 & "'") +
me.recharge
 

Users who are viewing this thread

Back
Top Bottom