JaredTaylor74
Technical User
I have a form that i need to show several different values, some are calculations, others are just stored data. because of this i can not use a query as my control source for my form so i am trying to use sql for each of my text boxes.
i have tried several different approaches, here is an example of a couple of the attempts on one of my text boxes.
with both of these when i step through it, the value of sqlSavingBalance is null. and my text box shows #NAME?
i'm sure once i get one to work, the others will be cake, but i can't seem to pinpoint my problem.
can someone help me out with this?
(using office 2000, windows xp)
Thank you,
Jared
i have tried several different approaches, here is an example of a couple of the attempts on one of my text boxes.
Code:
Dim SaveBalance As String
SaveBalance = "Saving"
sqlSavingBalance = "SELECT Sum(Amount) FROM tblTransactionAccountBalance WHERE ((([Account Type])=""" & SaveBalance & """));"
Me.txtSavingBalance.ControlSource = sqlSavingBalance
Code:
Dim SaveBalance As String
SaveBalance = "Saving"
sqlSavingBalance = "SELECT (Sum(IIf([Account Type]=""" & SaveBalance & """,[Amount]))) FROM tblTransactionAccountBalance;"
Me.txtSavingBalance.ControlSource = sqlSavingBalance
with both of these when i step through it, the value of sqlSavingBalance is null. and my text box shows #NAME?
i'm sure once i get one to work, the others will be cake, but i can't seem to pinpoint my problem.
can someone help me out with this?
(using office 2000, windows xp)
Thank you,
Jared