DLOOKUP For Button (1 Viewer)

Bandara

Member
Local time
Today, 22:11
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?
 

vba_php

Forum Troll
Local time
Today, 11:41
Joined
Oct 6, 2019
Messages
2,880
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.
 

Bandara

Member
Local time
Today, 22:11
Joined
Apr 17, 2020
Messages
60
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
 

Bandara

Member
Local time
Today, 22:11
Joined
Apr 17, 2020
Messages
60
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
 

vba_php

Forum Troll
Local time
Today, 11:41
Joined
Oct 6, 2019
Messages
2,880
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

Top Bottom