Next Month

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to set up a data base where it tells me who has a birthday next
month. I enter the following expression that works until the next month then
I have to go in and change the - number to show the following month or it
will show 2 months ahead and skip the following month (i.e. This is May, but
it is showing July instead of June.) This defeats the purpose of the query.
Any thoughts

Month(Date()+DateSerial(Year(Date()),Month(Date())-1,0))
 
You can use the before Update event of the text box to check if there are
duplicates, if there are give a message and stop the process

Something like
If DCount("*","TableName","Right([FieldName],4) =""" &
Right(Me.[TextBoxName,4) & """") > 0 Then
Msgbox "Record already exist"
Cancel = True 'stop the propcess
End If


Note: need to change the FieldName , TableNAme , TextBoxName to yours
 
Thanks, looks like it is working

Ofer Cohen said:
Try

Where Month([FieldName]) = Month(DateAdd("m",1,Date()))

--
Good Luck
BS"D


MTstraw said:
I am trying to set up a data base where it tells me who has a birthday next
month. I enter the following expression that works until the next month then
I have to go in and change the - number to show the following month or it
will show 2 months ahead and skip the following month (i.e. This is May, but
it is showing July instead of June.) This defeats the purpose of the query.
Any thoughts

Month(Date()+DateSerial(Year(Date()),Month(Date())-1,0))
 

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

Back
Top