In form load i make a connection....

then I have a sub fillfields()

FName.Text = rs.Fields("FirstName")
(trying it with one field first!!!)


Private Sub Fill_Click ()
Dim sql As string
sql = "SELECT * FROM customer WHERE (customerID = '" & IDtxt.Text & "')"
rs.Open sql, cn
fillfields
end sub


problem is IDtxt is filled by a value from another form....I first had the fill_click sub within the form load sub ....however I think the IDtxt was not filled by then so it gave an error.

The page works if i fill the text box instead of calling the value from another form.....

PH