Unable to run macro

junhize

New member
Local time
Today, 13:45
Joined
Oct 11, 2008
Messages
5
Hi guys, I've been trying to create a macro so that when i click on the 'search' button, it will get the data from the space for you the type. However, I keep getting this error: "Compile Error: Method or Data Member not found"

I'm trying to run QueryDisplay form to get the data keyed in and run a query. Can anyone help me out? Thanks alot :)

Option Compare Database
Option Explicit
Private Sub cmdSearch_Click()
Me.QueryDisplay.Requery
End Sub
Private Sub cmdReset_Click()
Me!txtArtiste = Null
Me!txtGender = Null
Me!txtSong = Null
Me!txtGenre = Null
Me!noMin = Null
Me!noMax = Null
Me!txtRecordLabel = Null
Me.txtAlbum = Null

Me!QueryDisplay.Requery
End Sub
Private Sub cmdViewQuery_Click()
DoCmd.OpenQuery "Query"
End Sub
Private Sub cmdPreviewReport_Click()
DoCmd.OpenForm "QueryDisplay", acViewPreview
End Sub
Private Sub cmdSearch_DblClick(Cancel As Integer)
End Sub
Private Sub Form_Load()
End Sub
 
is there anyline that is highlighted when you do this? This is actually clear as mud, so it's hard to tell what you really want here. there are 5 different SUBS in the code you provided. The search button SUB has one line in it. If the form called QueryDisplay is not opened, then that is probably the reason for the error. If it's not open, it can't be found.
 

Users who are viewing this thread

Back
Top Bottom