When the error occurs check the debugger for the value of thisform.cboSurname.value. I get the impression that it hasn't been populated with the login name yet and is still NULL.
>I am encountering a 'Data Type Mismatch' error when I go into my form for the first time. Here is the information for my environment:
>
>- in my database container I have a table called Staff. In the Staff table there is a field called kstaff which is char 6. I also have a primrary key on that field called kstaff;
>
>- on my form I have a surname combo box. I want this combo box to be loaded by default with the name of the person who logged into my system. This works. The information for my surname combobox is as follows:
> Bound Column : 2
> Row Source : select surname,kstaff from staff order by surname into cursor csurname
> Row Source Type: 3 - SQL Statement
> Style: : 2 - Dropdown List
>
>- the refresh method of my surname combo box is as follows:
> DODEFAULT()
> =SEEK(thisform.cboSurname.value,"staff","kstaff")
>
>- in the watch window of the debugger at this line in my code I verified the following values:
> thisform.cboSurname.value = "000003"
> staff.kstaff = " "
>
>During the init method of my form, at a thisform.refresh statement, the following error occurs:
> Data Type Mismatch
> Method: refresh
> Line: 2 (which is the =SEEK... line)
>I hope this is enough information to understand what I'm trying to do.
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada
cmagee@metroland.comNever mistake having a career with having a life.