bruceblack
Registered User.
- Local time
- Today, 04:01
- Joined
- Jun 30, 2017
- Messages
- 119
Hi everyone! Im a little bit stuck here on how to approach what im trying to do.
Some help would be nice You guys always save the day.
What im trying to do on my form is play a sound file when a certain value appears in one of the form fields. Now, dont worry! I got the whole sound file and field value nailed. It works.
My problem:
I need to search this value in a query (1 particular column actually).
My form executes a requery, and when it does i want it to check if the value "30" is in that column. How do i do this?
Here's my code so far. Doesnt give me an error, it does nothing really...
Private Sub Form_Timer()
DoCmd.Requery
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT * FROM cosumersquery")
If drinks.Value = 30 Then 'this is my form field
API_PlaySound "D:\exceeded.wav"
Else
End If
rs.Close 'Close the recordset
Set rs = Nothing 'Clean up
End Sub
As you can see im looking through my cosumers query.
The column i actually want to search in that query is called "drinks".
Thanks in advance guys!
Some help would be nice You guys always save the day.
What im trying to do on my form is play a sound file when a certain value appears in one of the form fields. Now, dont worry! I got the whole sound file and field value nailed. It works.
My problem:
I need to search this value in a query (1 particular column actually).
My form executes a requery, and when it does i want it to check if the value "30" is in that column. How do i do this?
Here's my code so far. Doesnt give me an error, it does nothing really...
Private Sub Form_Timer()
DoCmd.Requery
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT * FROM cosumersquery")
If drinks.Value = 30 Then 'this is my form field
API_PlaySound "D:\exceeded.wav"
Else
End If
rs.Close 'Close the recordset
Set rs = Nothing 'Clean up
End Sub
As you can see im looking through my cosumers query.
The column i actually want to search in that query is called "drinks".
Thanks in advance guys!