Help with module

G

Guest

This module is causing a "Compile error: User-defined type not defined". It
hilights the first Dim statement - Dim rst As DAO.Recordset. If I take of the
DAO. then I get "Compile error: Method or data memeber not found" and it
highlights rst.Findfirst in my If statement.

Does anyone have any ideas on how to fix this?

Thanks in advance

Private Sub GoToLogEntryLabel_Click()

Dim rst As DAO.Recordset
Dim RecordToFind As String
Dim GUIDofRecord As String
Dim ItemSelectCount As Integer

ItemSelectCount = Me.FilteredLogEntryList.ItemsSelected.Count

If ItemSelectCount > 0 Then
GUIDofRecord = StringFromGUID(Me.FilteredLogEntryList.Column(0))
RecordToFind = "[StringContactID]='" & GUIDofRecord & "'"


Set rst = Forms!contactlogform.RecordsetClone
rst.FindFirst RecordToFind
Forms!contactlogform.Recordset.Bookmark = rst.Bookmark

Set rst = Nothing

DoCmd.Close acForm, "SearchLogForm"
Else
MsgBox "Please select a log entry from the list first.", , "Select
an log entry to find"
End If

End Sub
 
M

Michael J. Strickland

Sounds like you may not have the DAO Object Library reference set.

Make sure "Microsoft DAO 3.x Object Library" is checked in
Tools->References.
 
G

Guest

Thanks.

It fixed the first problem but now this message is coming up: "Compile
error: Method or data member not found" when it hits "rst.FindFirst
RecordToFind"

See original post for full code.




Michael J. Strickland said:
Sounds like you may not have the DAO Object Library reference set.

Make sure "Microsoft DAO 3.x Object Library" is checked in
Tools->References.

--
---------------------------------------------------------------
Michael J. Strickland
Quality Services (e-mail address removed)
703-560-7380
---------------------------------------------------------------
LatinoEJG said:
This module is causing a "Compile error: User-defined type not defined".
It
hilights the first Dim statement - Dim rst As DAO.Recordset. If I take of
the
DAO. then I get "Compile error: Method or data memeber not found" and it
highlights rst.Findfirst in my If statement.

Does anyone have any ideas on how to fix this?

Thanks in advance

Private Sub GoToLogEntryLabel_Click()

Dim rst As DAO.Recordset
Dim RecordToFind As String
Dim GUIDofRecord As String
Dim ItemSelectCount As Integer

ItemSelectCount = Me.FilteredLogEntryList.ItemsSelected.Count

If ItemSelectCount > 0 Then
GUIDofRecord = StringFromGUID(Me.FilteredLogEntryList.Column(0))
RecordToFind = "[StringContactID]='" & GUIDofRecord & "'"


Set rst = Forms!contactlogform.RecordsetClone
rst.FindFirst RecordToFind
Forms!contactlogform.Recordset.Bookmark = rst.Bookmark

Set rst = Nothing

DoCmd.Close acForm, "SearchLogForm"
Else
MsgBox "Please select a log entry from the list first.", , "Select
an log entry to find"
End If

End Sub
 
G

Guest

Run it through the debugger. 'rst' is probably not being set. What does the
RecordSetClone control on your 'contactlogform' contain?
--
Chaim


LatinoEJG said:
Thanks.

It fixed the first problem but now this message is coming up: "Compile
error: Method or data member not found" when it hits "rst.FindFirst
RecordToFind"

See original post for full code.




Michael J. Strickland said:
Sounds like you may not have the DAO Object Library reference set.

Make sure "Microsoft DAO 3.x Object Library" is checked in
Tools->References.

--
---------------------------------------------------------------
Michael J. Strickland
Quality Services (e-mail address removed)
703-560-7380
---------------------------------------------------------------
LatinoEJG said:
This module is causing a "Compile error: User-defined type not defined".
It
hilights the first Dim statement - Dim rst As DAO.Recordset. If I take of
the
DAO. then I get "Compile error: Method or data memeber not found" and it
highlights rst.Findfirst in my If statement.

Does anyone have any ideas on how to fix this?

Thanks in advance

Private Sub GoToLogEntryLabel_Click()

Dim rst As DAO.Recordset
Dim RecordToFind As String
Dim GUIDofRecord As String
Dim ItemSelectCount As Integer

ItemSelectCount = Me.FilteredLogEntryList.ItemsSelected.Count

If ItemSelectCount > 0 Then
GUIDofRecord = StringFromGUID(Me.FilteredLogEntryList.Column(0))
RecordToFind = "[StringContactID]='" & GUIDofRecord & "'"


Set rst = Forms!contactlogform.RecordsetClone
rst.FindFirst RecordToFind
Forms!contactlogform.Recordset.Bookmark = rst.Bookmark

Set rst = Nothing

DoCmd.Close acForm, "SearchLogForm"
Else
MsgBox "Please select a log entry from the list first.", , "Select
an log entry to find"
End If

End Sub
 
D

Douglas J. Steele

Did you put the DAO.Recordset back in?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



LatinoEJG said:
Thanks.

It fixed the first problem but now this message is coming up: "Compile
error: Method or data member not found" when it hits "rst.FindFirst
RecordToFind"

See original post for full code.




Michael J. Strickland said:
Sounds like you may not have the DAO Object Library reference set.

Make sure "Microsoft DAO 3.x Object Library" is checked in
Tools->References.

--
---------------------------------------------------------------
Michael J. Strickland
Quality Services (e-mail address removed)
703-560-7380
---------------------------------------------------------------
LatinoEJG said:
This module is causing a "Compile error: User-defined type not
defined".
It
hilights the first Dim statement - Dim rst As DAO.Recordset. If I take
of
the
DAO. then I get "Compile error: Method or data memeber not found" and
it
highlights rst.Findfirst in my If statement.

Does anyone have any ideas on how to fix this?

Thanks in advance

Private Sub GoToLogEntryLabel_Click()

Dim rst As DAO.Recordset
Dim RecordToFind As String
Dim GUIDofRecord As String
Dim ItemSelectCount As Integer

ItemSelectCount = Me.FilteredLogEntryList.ItemsSelected.Count

If ItemSelectCount > 0 Then
GUIDofRecord = StringFromGUID(Me.FilteredLogEntryList.Column(0))
RecordToFind = "[StringContactID]='" & GUIDofRecord & "'"


Set rst = Forms!contactlogform.RecordsetClone
rst.FindFirst RecordToFind
Forms!contactlogform.Recordset.Bookmark = rst.Bookmark

Set rst = Nothing

DoCmd.Close acForm, "SearchLogForm"
Else
MsgBox "Please select a log entry from the list first.", ,
"Select
an log entry to find"
End If

End Sub
 
G

Guest

Thank you; It works like a charm!!!

Douglas J. Steele said:
Did you put the DAO.Recordset back in?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



LatinoEJG said:
Thanks.

It fixed the first problem but now this message is coming up: "Compile
error: Method or data member not found" when it hits "rst.FindFirst
RecordToFind"

See original post for full code.



highlights rst.Findfirst in my If statement.

Michael J. Strickland said:
Sounds like you may not have the DAO Object Library reference set.

Make sure "Microsoft DAO 3.x Object Library" is checked in
Tools->References.

--
---------------------------------------------------------------
Michael J. Strickland
Quality Services (e-mail address removed)
703-560-7380
---------------------------------------------------------------
This module is causing a "Compile error: User-defined type not
defined".
It
hilights the first Dim statement - Dim rst As DAO.Recordset. If I take
of
the
DAO. then I get "Compile error: Method or data memeber not found" and
it
highlights rst.Findfirst in my If statement.

Does anyone have any ideas on how to fix this?

Thanks in advance

Private Sub GoToLogEntryLabel_Click()

Dim rst As DAO.Recordset
Dim RecordToFind As String
Dim GUIDofRecord As String
Dim ItemSelectCount As Integer

ItemSelectCount = Me.FilteredLogEntryList.ItemsSelected.Count

If ItemSelectCount > 0 Then
GUIDofRecord = StringFromGUID(Me.FilteredLogEntryList.Column(0))
RecordToFind = "[StringContactID]='" & GUIDofRecord & "'"


Set rst = Forms!contactlogform.RecordsetClone
rst.FindFirst RecordToFind
Forms!contactlogform.Recordset.Bookmark = rst.Bookmark

Set rst = Nothing

DoCmd.Close acForm, "SearchLogForm"
Else
MsgBox "Please select a log entry from the list first.", ,
"Select
an log entry to find"
End If

End Sub
 
G

Guest

Thank you; it works like a charm!!!

Chaim said:
Run it through the debugger. 'rst' is probably not being set. What does the
RecordSetClone control on your 'contactlogform' contain?
--
Chaim


LatinoEJG said:
Thanks.

It fixed the first problem but now this message is coming up: "Compile
error: Method or data member not found" when it hits "rst.FindFirst
RecordToFind"

See original post for full code.



highlights rst.Findfirst in my If statement.

Michael J. Strickland said:
Sounds like you may not have the DAO Object Library reference set.

Make sure "Microsoft DAO 3.x Object Library" is checked in
Tools->References.

--
---------------------------------------------------------------
Michael J. Strickland
Quality Services (e-mail address removed)
703-560-7380
---------------------------------------------------------------
This module is causing a "Compile error: User-defined type not defined".
It
hilights the first Dim statement - Dim rst As DAO.Recordset. If I take of
the
DAO. then I get "Compile error: Method or data memeber not found" and it
highlights rst.Findfirst in my If statement.

Does anyone have any ideas on how to fix this?

Thanks in advance

Private Sub GoToLogEntryLabel_Click()

Dim rst As DAO.Recordset
Dim RecordToFind As String
Dim GUIDofRecord As String
Dim ItemSelectCount As Integer

ItemSelectCount = Me.FilteredLogEntryList.ItemsSelected.Count

If ItemSelectCount > 0 Then
GUIDofRecord = StringFromGUID(Me.FilteredLogEntryList.Column(0))
RecordToFind = "[StringContactID]='" & GUIDofRecord & "'"


Set rst = Forms!contactlogform.RecordsetClone
rst.FindFirst RecordToFind
Forms!contactlogform.Recordset.Bookmark = rst.Bookmark

Set rst = Nothing

DoCmd.Close acForm, "SearchLogForm"
Else
MsgBox "Please select a log entry from the list first.", , "Select
an log entry to find"
End If

End Sub
 
G

Guest

Thank you for your help; it works like a charm!!!

Michael J. Strickland said:
Sounds like you may not have the DAO Object Library reference set.

Make sure "Microsoft DAO 3.x Object Library" is checked in
Tools->References.

--
---------------------------------------------------------------
Michael J. Strickland
Quality Services (e-mail address removed)
703-560-7380
---------------------------------------------------------------
LatinoEJG said:
This module is causing a "Compile error: User-defined type not defined".
It
hilights the first Dim statement - Dim rst As DAO.Recordset. If I take of
the
DAO. then I get "Compile error: Method or data memeber not found" and it
highlights rst.Findfirst in my If statement.

Does anyone have any ideas on how to fix this?

Thanks in advance

Private Sub GoToLogEntryLabel_Click()

Dim rst As DAO.Recordset
Dim RecordToFind As String
Dim GUIDofRecord As String
Dim ItemSelectCount As Integer

ItemSelectCount = Me.FilteredLogEntryList.ItemsSelected.Count

If ItemSelectCount > 0 Then
GUIDofRecord = StringFromGUID(Me.FilteredLogEntryList.Column(0))
RecordToFind = "[StringContactID]='" & GUIDofRecord & "'"


Set rst = Forms!contactlogform.RecordsetClone
rst.FindFirst RecordToFind
Forms!contactlogform.Recordset.Bookmark = rst.Bookmark

Set rst = Nothing

DoCmd.Close acForm, "SearchLogForm"
Else
MsgBox "Please select a log entry from the list first.", , "Select
an log entry to find"
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top