I am trying to access a database, but get an error. This is the code i am using.
Form Load
VB Code:
Private Sub Form_Load() MyFile = App.Path & "\Copy of Diary.mdb" Set MyDatabase = OpenDatabase(MyFile) End Sub
Command Button
VB Code:
SqLtXt = "SELECT Entry.Date, Entry.Subject, Entry.Entry" SqLtXt = SqLtXt + " From Entry" SqLtXt = SqLtXt + " WHERE Entry.Date = " & dtpDate.Value Set MySearch = MyDatabase.OpenRecordset(SqLtXt) txtSubject.Text = MySearch!Subject & "" txtEntry.Text = MySearch!Entry
What am i doing wrong, the error is...
"3021, No current record".
Which isnt true because there is a record called 03/06/2005 in the database.
Thank you
ILMV




Reply With Quote