Next Month

M

MTstraw

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))
 
O

Ofer Cohen

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
 
M

MTstraw

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))
 
Top