G
Guest
I am trying to figure out how I can program an If Statement into a subform.
I have already set up a second combo box that is populated after the user
makes a choice from the first combo box. Now what I'm trying to figure out
is how I can setup the statement so that the second combo box selection would
run a query through a series of "if" conditions. I am dealing with number
ranges in account number format (for example: 101.10000, 101.10050, and
210.12575). What I would like to do is by choosing a certain book listing(1A,
1B, or even 6O), the subform with run an SQL statement after testing the "if"
statement. The idea I have followes( I have a little Java programming
experience, but I new to VB):
If (Combo55 = "1A") Then accountInfoSubForm = "SELECT [>101.10000 &
<102.10000] FROM accountInfo ORDER BY accountNumber"
Else If (Combo55 = "1B") Then accountInfoForm = "SELECT [>102.10000 &
<103.10000] FROM accountInfo ORDER BY accountNumber"
And so on til the condition hits a listing of (Combo55 = 6O).
Combo55 is contained within the form printCenter,
accountInfoSubForm is the subform within printCenter,
and the table is listed as accountInfo.
(Sorry to explain, just want to make as clear as possible)
Any help would be greatly appreciated, and I'm everyone's getting sick of my
postings.
FigDaddy
I have already set up a second combo box that is populated after the user
makes a choice from the first combo box. Now what I'm trying to figure out
is how I can setup the statement so that the second combo box selection would
run a query through a series of "if" conditions. I am dealing with number
ranges in account number format (for example: 101.10000, 101.10050, and
210.12575). What I would like to do is by choosing a certain book listing(1A,
1B, or even 6O), the subform with run an SQL statement after testing the "if"
statement. The idea I have followes( I have a little Java programming
experience, but I new to VB):
If (Combo55 = "1A") Then accountInfoSubForm = "SELECT [>101.10000 &
<102.10000] FROM accountInfo ORDER BY accountNumber"
Else If (Combo55 = "1B") Then accountInfoForm = "SELECT [>102.10000 &
<103.10000] FROM accountInfo ORDER BY accountNumber"
And so on til the condition hits a listing of (Combo55 = 6O).
Combo55 is contained within the form printCenter,
accountInfoSubForm is the subform within printCenter,
and the table is listed as accountInfo.
(Sorry to explain, just want to make as clear as possible)
Any help would be greatly appreciated, and I'm everyone's getting sick of my
postings.
FigDaddy