PC Review


Reply
Thread Tools Rate Thread

2 options based on result

 
 
fishqqq@hotmail.com
Guest
Posts: n/a
 
      14th Aug 2011
Can someone tell me how to write an 'if' argument that would do the
following:

[field1] = predetermined date&time
[field2] = now()

i would like the program to compare the two fields and do the
following

if [field1]>[field2] then open [form1]
if [field 1]<[field2] then open [form2]

Can someone please help me get my head around this?

thanks
Steve

 
Reply With Quote
 
 
 
 
Ken Snell
Guest
Posts: n/a
 
      14th Aug 2011
If [field1] > [field2] Then
DoCmd.OpenForm "form1"
ElseIf [field1] < [field2] Then
DoCmd.OpenForm "form2"
Else
MsgBox "Values are equal"
End If
--

Ken Snell
http://www.accessmvp.com/KDSnell/




<(E-Mail Removed)> wrote in message
news:2730d55b-0af5-477f-80f9-(E-Mail Removed)...
> Can someone tell me how to write an 'if' argument that would do the
> following:
>
> [field1] = predetermined date&time
> [field2] = now()
>
> i would like the program to compare the two fields and do the
> following
>
> if [field1]>[field2] then open [form1]
> if [field 1]<[field2] then open [form2]
>
> Can someone please help me get my head around this?
>
> thanks
> Steve
>



 
Reply With Quote
 
fishqqq@hotmail.com
Guest
Posts: n/a
 
      14th Aug 2011
On Aug 14, 12:55*pm, "Ken Snell" <kthsneisll...@ncoomcastt.renaetl>
wrote:
> If [field1] > [field2] Then
> * * DoCmd.OpenForm "form1"
> ElseIf [field1] < [field2] Then
> * * DoCmd.OpenForm "form2"
> Else
> * * MsgBox "Values are equal"
> End If
> --
>
> * * * * Ken Snellhttp://www.accessmvp.com/KDSnell/
>
> <fish...@hotmail.com> wrote in message
>
> news:2730d55b-0af5-477f-80f9-(E-Mail Removed)...
>
>
>
>
>
>
>
> > Can someone tell me how to write an 'if' argument that would do the
> > following:

>
> > [field1] = predetermined date&time
> > [field2] = now()

>
> > i would like the program to compare the two fields and do the
> > following

>
> > if [field1]>[field2] then open [form1]
> > if [field 1]<[field2] then open [form2]

>
> > Can someone please help me get my head around this?

>
> > thanks
> > Steve


Thanks Ken
 
Reply With Quote
 
fishqqq@hotmail.com
Guest
Posts: n/a
 
      16th Aug 2011
On Aug 14, 1:06*pm, "fish...@hotmail.com" <fish...@hotmail.com> wrote:
> On Aug 14, 12:55*pm, "Ken Snell" <kthsneisll...@ncoomcastt.renaetl>
> wrote:
>
>
>
>
>
>
>
>
>
> > If [field1] > [field2] Then
> > * * DoCmd.OpenForm "form1"
> > ElseIf [field1] < [field2] Then
> > * * DoCmd.OpenForm "form2"
> > Else
> > * * MsgBox "Values are equal"
> > End If
> > --

>
> > * * * * Ken Snellhttp://www.accessmvp.com/KDSnell/

>
> > <fish...@hotmail.com> wrote in message

>
> >news:2730d55b-0af5-477f-80f9-(E-Mail Removed)....

>
> > > Can someone tell me how to write an 'if' argument that would do the
> > > following:

>
> > > [field1] = predetermined date&time
> > > [field2] = now()

>
> > > i would like the program to compare the two fields and do the
> > > following

>
> > > if [field1]>[field2] then open [form1]
> > > if [field 1]<[field2] then open [form2]

>
> > > Can someone please help me get my head around this?

>
> > > thanks
> > > Steve

>
> Thanks Ken



Ken, i`m running into a problem now. Below is the code with the
correct field and form names

I`m really doing 2 steps here.

step1- update text1 to now()
step2- compare the value of text1 to locktrigger and act accordingly.

question is how do i separate the steps so this will run correctly


Private Sub Form_Load()
Text1 = Now()

If [locktrigger] > [Text1] Then
DoCmd.OpenForm "frmLogin1"
ElseIf [locktrigger] < [Text1] Then
DoCmd.OpenForm "terms"
Else
MsgBox "Values are equal"
End If
End Sub
 
Reply With Quote
 
Ken Snell
Guest
Posts: n/a
 
      18th Aug 2011
I don't understand your question about 'separating the steps'? Can you
elaborate on what that means?
--

Ken Snell
http://www.accessmvp.com/KDSnell/


<(E-Mail Removed)> wrote in message
news:455d29e6-f867-4bd9-9a40-(E-Mail Removed)...
On Aug 14, 1:06 pm, "fish...@hotmail.com" <fish...@hotmail.com> wrote:
> On Aug 14, 12:55 pm, "Ken Snell" <kthsneisll...@ncoomcastt.renaetl>
> wrote:
>
>
>
>
>
>
>
>
>
> > If [field1] > [field2] Then
> > DoCmd.OpenForm "form1"
> > ElseIf [field1] < [field2] Then
> > DoCmd.OpenForm "form2"
> > Else
> > MsgBox "Values are equal"
> > End If
> > --

>
> > Ken Snellhttp://www.accessmvp.com/KDSnell/

>
> > <fish...@hotmail.com> wrote in message

>
> >news:2730d55b-0af5-477f-80f9-(E-Mail Removed)...

>
> > > Can someone tell me how to write an 'if' argument that would do the
> > > following:

>
> > > [field1] = predetermined date&time
> > > [field2] = now()

>
> > > i would like the program to compare the two fields and do the
> > > following

>
> > > if [field1]>[field2] then open [form1]
> > > if [field 1]<[field2] then open [form2]

>
> > > Can someone please help me get my head around this?

>
> > > thanks
> > > Steve

>
> Thanks Ken



Ken, i`m running into a problem now. Below is the code with the
correct field and form names

I`m really doing 2 steps here.

step1- update text1 to now()
step2- compare the value of text1 to locktrigger and act accordingly.

question is how do i separate the steps so this will run correctly


Private Sub Form_Load()
Text1 = Now()

If [locktrigger] > [Text1] Then
DoCmd.OpenForm "frmLogin1"
ElseIf [locktrigger] < [Text1] Then
DoCmd.OpenForm "terms"
Else
MsgBox "Values are equal"
End If
End Sub


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Result based on two criteria Ben12956 Microsoft Excel Worksheet Functions 3 2nd Feb 2010 06:09 PM
Multiple criteria options determine which name to show as result. =?Utf-8?B?VHdpc2hsaXN0?= Microsoft Excel Worksheet Functions 1 10th Apr 2007 09:05 AM
Result based on drop down =?Utf-8?B?U3VlUXVlZW4=?= Microsoft Word Document Management 1 18th May 2006 07:43 PM
I get field code instead of result: I cleared on options/print =?Utf-8?B?TWljaGFlbCBDYW50d2VsbA==?= Microsoft Word Document Management 1 6th Jan 2006 09:09 PM
vlookup based on random result returns incorrect result =?Utf-8?B?cmlja2F0?= Microsoft Excel Worksheet Functions 1 6th Dec 2005 01:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:02 PM.