Hopefully, someone can help me out here.
I have a control array of 9 textboxes. I want to pass the array of the textbox to a subwhere processing can occur for each instance of textbox.text
The textboxes contain name, address, city, state, etc... in the sub, I want add these to a database. I want to use this sub, as customers will be added from more than one screen.
ie:
From Form1:
=============================
sub cmdAddCustomer_click()
dbCustAdd(textbox1())
end sub
=============================
From Module1
=============================
Sub dbCustAdd(textbox as TextBox)
sqlString = "insert into customers values('"
for each textbox1.text in textbox1
sqlString-sqlString & textbox1.text & "'"
next
db.execute(sqlString)
end sub
==============================
This does not work... can anyone help?
TIA,
Chris
I have a control array of 9 textboxes. I want to pass the array of the textbox to a subwhere processing can occur for each instance of textbox.text
The textboxes contain name, address, city, state, etc... in the sub, I want add these to a database. I want to use this sub, as customers will be added from more than one screen.
ie:
From Form1:
=============================
sub cmdAddCustomer_click()
dbCustAdd(textbox1())
end sub
=============================
From Module1
=============================
Sub dbCustAdd(textbox as TextBox)
sqlString = "insert into customers values('"
for each textbox1.text in textbox1
sqlString-sqlString & textbox1.text & "'"
next
db.execute(sqlString)
end sub
==============================
This does not work... can anyone help?
TIA,
Chris