I need to bill people monthly within a set period and within a set budget. My table (tB) has fields (M1 etc) each representing a month’s billing. Because the query coming from it uses a lot of itineration (carrying forward of balances, each with quite involved Iif statements, I keep getting the error message “Query too complex”. So I’ve given up and have to write the query in VBA.
I need to know how to bring the values of fields in tB, do the necessary, and display the results in a form with arrays of textboxes for each month of the year. I’ve tried using “Anna’s” suggestion (thanks Anna) as below but it doesn’t work. What is the command for getting a field? And, after completing the procedure, passing the results in other tables or queries?
Option Compare Database
Private Sub Form_Load()
Dim CurrentDb.TableDefs("tb").Fields("M1").Value as integer ‘January Input
Dim CurrentDb.TableDefs("tb").Fields("M2").Value as integer ‘February Input
……Repeat until Field M12 incl.
For fc = 1 To 12
M(fc)= TextBox M(fc)
Next M(fc)
End Sub
I need to know how to bring the values of fields in tB, do the necessary, and display the results in a form with arrays of textboxes for each month of the year. I’ve tried using “Anna’s” suggestion (thanks Anna) as below but it doesn’t work. What is the command for getting a field? And, after completing the procedure, passing the results in other tables or queries?
Option Compare Database
Private Sub Form_Load()
Dim CurrentDb.TableDefs("tb").Fields("M1").Value as integer ‘January Input
Dim CurrentDb.TableDefs("tb").Fields("M2").Value as integer ‘February Input
……Repeat until Field M12 incl.
For fc = 1 To 12
M(fc)= TextBox M(fc)
Next M(fc)
End Sub