Lesson 36 - I am getting a compile - user defined type not defined error.
***NOTE***: I did not need the advanced security of disabling and hiding the windows. I am wondering if something was set then that this is trying to reference and I don't have it. My database has a logon and hidden buttons but not disable/enable keys for links, db windows or the bypass keys. I have checked syntax several times and I cannot figure it out.
Here is my code - first line is highlighted yellow when I debug: Public Sub LogIt(Description As String, Optional Notes As String = "")
Dim ProgramLeaderID As Long Dim db As Database Dim rs As Recordset
' on error resume next ProgramLeaderID = Nz(Forms!mainmenu!txtProgramLeaderID) Set db = CurrentDb() Set rs = db.Openrecordset("log", dbopendynaset) rs.AddNew rs!ProgramLeaderID = ProgramLeaderID rs!Description = Description If Notes <> "" Then rs!Notes = Notes rs.update rs.Close Set rs = Nothing Set db = Nothing
What am I missing?
Thanks. Lisa
Reply from Richard Rost:
Which line is highlighted yellow? If it's the "Dim db as Database" line then you're probably missing your DAO reference... covered in an earlier lesson.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.