Solved

how to open a from one form another form with a few where conditions in access 2013

Posted on 2013-10-31
5
434 Views
Last Modified: 2013-10-31
hi

i have a command button that open another form and have a where condition that by the  field reminderdate the date has been already, so it's have two conditon, that the reminderdate field is not null, and the date has been already.

how i write this two condions something like this:

DoCmd.OpenForm "MIncomeDetailsF", , , ReminderDate <= Date and reminderdate<>""

Open in new window

thanks alot
0
Comment
Question by:bill201
  • 3
  • 2
5 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 39613642
Try this:


DoCmd.OpenForm "MIncomeDetailsF", , , ReminderDate <= Date and reminderdate IS NOT NULL

Open in new window


Or this:


DoCmd.OpenForm "MIncomeDetailsF", , , ReminderDate <= Date and IsDate(reminderdate) = True

Open in new window

0
 

Author Comment

by:bill201
ID: 39613671
thansk for your answer but it's dosn't work, it's open the form MIncomeDetailsF with no data in that, like there is no record that matching  the Criterias (although that the form conatin data that match this criterias).
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39613678
Oh - we forgot the quotes on the conditions:

DoCmd.OpenForm "MIncomeDetailsF", , , "ReminderDate <= Date() and reminderdate IS NOT NULL"

Open in new window


Or this:

DoCmd.OpenForm "MIncomeDetailsF", , , "ReminderDate <= Date() and IsDate(reminderdate) = True"

Open in new window

0
 

Author Comment

by:bill201
ID: 39613686
now it's working thanks alot
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39613688
This is a slightly cleaner variation... using a string variable for the criteria:


Dim strSQL as String
strSQL = "ReminderDate <= Date() and reminderdate IS NOT NULL"
 
DoCmd.OpenForm "MIncomeDetailsF", WhereCondition := strSQL

Open in new window


Or this:

Dim strSQL as String
strSQL = "ReminderDate <= Date() and IsDate(reminderdate) = True"
DoCmd.OpenForm "MIncomeDetailsF", WhereCondition := strSQL

Open in new window

0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now