Compile Error, Type Mismatch (1 Viewer)

Bigmo2u

Registered User.
Local time
Today, 09:30
Joined
Nov 29, 2005
Messages
200
I am not sure why i am gettting a compile error, type Mismatch. Maybe my brain is fried and I cant see it.

Code:
Dim uName As String
Dim strfName As String
Dim strlName As String
Dim db As DAO.Database
Dim rs As DAO.Database
Dim iSQL As String

uName = CStr(fOSUserName)

If IsNull(uName) Then
    MsgBox "It Appears your name is not registered with the Database, " & vbCrLf & vbCrLf & _
           "Take a moment to register.", vbOKOnly, "Missing User Name"
    
    DoCmd.OpenForm "frmOwner", acNormal
Else
    iSQL = "SELECT tblOwner.oFirst, tblOwner.oLast " & _
           "FROM tblOwner " & _
           "WHERE tblOwner.WindowsLogin = '" & uName & "'"
    Set db = CurrentDb
    Set rs = db.OpenRecordset(iSQL, dbOpenDynaset)
    
    With rs
        [COLOR="Red"]strfName[/COLOR] = rs!oFirst
        strlName = rs!oLast
        .Close
    End With
    
    MsgBox "Welcome " & strfName & " " & strlName & "To the Joint Application Teams Management System.", vbOKOnly, "Welcome To The JAT Management System"

    Set rs = Nothing
    Set db = Nothing
End If

:banghead:
 
Last edited:

spikepl

Eledittingent Beliped
Local time
Today, 16:30
Joined
Nov 3, 2010
Messages
6,142
It must be this line:

Code:

or perhapsnot, since you have not mentioned which.
 

Bigmo2u

Registered User.
Local time
Today, 09:30
Joined
Nov 29, 2005
Messages
200
Spikepl ~ I udated the code. the Read shows the error.

i cant see what you put out there as a suggestion either.
 

Bigmo2u

Registered User.
Local time
Today, 09:30
Joined
Nov 29, 2005
Messages
200
Stupid Me, I found the error.

Code:
Dim rs AS DAO.Database

S/B
Code:
Dim rs AS DAO.Recordset
 

Users who are viewing this thread

Top Bottom