PC Review


Reply
Thread Tools Rate Thread

Yes No message box

 
 
nancy
Guest
Posts: n/a
 
      16th Sep 2009
I have a check in system for participants for of a nonprofit organization.
The participants need to check in each time they come in and shop. When
signing in they choose their name from a combo box and the click the sign-in
button that runs to below event procedure. This works great. However some
time someone else will sign-in for the participant under the participants
name. I would like to modify the below event procedure that asks the
following questions.

Are you Sam ( the selected person). Yes or No.
If Yes then sign in Sam.
IF no. Are you shopping for Sam?
IF Yes. Please type in your name. (I will call this the Altperson)

Once the Altperson types in their name. I want the altperon name be added
to Sam’s ( or the selected perons) sign-in information.

Private Sub cmdSignIn_Click()
If IsNull(cboName) Then
MsgBox "Please select your name from the drop down list. Favor de
seleccionar su nombre de la lista siguiente"
ElseIf DCount("ShopID", "Shoplog", "volID=" & cboName & " And
ShopDate=Date()") = 0 Then
DoCmd.RunSQL "Insert Into Shoplog (volID, ShopDate, SHOPSignin) Values("
& cboName & ",Date(),Time());"
MsgBox cboName.Column(1) & ", you have signed in successfully!"
cboName = Null
DoCmd.Close

Else
MsgBox cboName.Column(1) & ", you have already signed in today! Ya se
ha registrado por el dia de hoy."

End If

 
Reply With Quote
 
 
 
 
David H
Guest
Posts: n/a
 
      16th Sep 2009
The MsgBox can be used as a function which returns a result as in

result = MsgBox(...)
If result = vbYes then
end if

If result = vbNo then
end if

However, I would suggest going with an approach that eliminates or reduces
the ability of the person to sign in as somebody else. I would probably go
with a form whereby the user enters their phone number (or other unique
identifier) to select their information then clicks 'Sign-In' to actually
sign in. Anytime you're presenting a person with a list of options there's
always the possibility that they may not select the right one either
intentionally or by accident.

"nancy" wrote:

> I have a check in system for participants for of a nonprofit organization.
> The participants need to check in each time they come in and shop. When
> signing in they choose their name from a combo box and the click the sign-in
> button that runs to below event procedure. This works great. However some
> time someone else will sign-in for the participant under the participants
> name. I would like to modify the below event procedure that asks the
> following questions.
>
> Are you Sam ( the selected person). Yes or No.
> If Yes then sign in Sam.
> IF no. Are you shopping for Sam?
> IF Yes. Please type in your name. (I will call this the Altperson)
>
> Once the Altperson types in their name. I want the altperon name be added
> to Sam’s ( or the selected perons) sign-in information.
>
> Private Sub cmdSignIn_Click()
> If IsNull(cboName) Then
> MsgBox "Please select your name from the drop down list. Favor de
> seleccionar su nombre de la lista siguiente"
> ElseIf DCount("ShopID", "Shoplog", "volID=" & cboName & " And
> ShopDate=Date()") = 0 Then
> DoCmd.RunSQL "Insert Into Shoplog (volID, ShopDate, SHOPSignin) Values("
> & cboName & ",Date(),Time());"
> MsgBox cboName.Column(1) & ", you have signed in successfully!"
> cboName = Null
> DoCmd.Close
>
> Else
> MsgBox cboName.Column(1) & ", you have already signed in today! Ya se
> ha registrado por el dia de hoy."
>
> End If
>

 
Reply With Quote
 
nancy
Guest
Posts: n/a
 
      16th Sep 2009
Thanks for the info. I will pass it on.

I typed in the message box information however I get a Comple error:
Variable not Defined. What am I missing?

"David H" wrote:

> The MsgBox can be used as a function which returns a result as in
>
> result = MsgBox(...)
> If result = vbYes then
> end if
>
> If result = vbNo then
> end if
>
> However, I would suggest going with an approach that eliminates or reduces
> the ability of the person to sign in as somebody else. I would probably go
> with a form whereby the user enters their phone number (or other unique
> identifier) to select their information then clicks 'Sign-In' to actually
> sign in. Anytime you're presenting a person with a list of options there's
> always the possibility that they may not select the right one either
> intentionally or by accident.
>
> "nancy" wrote:
>
> > I have a check in system for participants for of a nonprofit organization.
> > The participants need to check in each time they come in and shop. When
> > signing in they choose their name from a combo box and the click the sign-in
> > button that runs to below event procedure. This works great. However some
> > time someone else will sign-in for the participant under the participants
> > name. I would like to modify the below event procedure that asks the
> > following questions.
> >
> > Are you Sam ( the selected person). Yes or No.
> > If Yes then sign in Sam.
> > IF no. Are you shopping for Sam?
> > IF Yes. Please type in your name. (I will call this the Altperson)
> >
> > Once the Altperson types in their name. I want the altperon name be added
> > to Sam’s ( or the selected perons) sign-in information.
> >
> > Private Sub cmdSignIn_Click()
> > If IsNull(cboName) Then
> > MsgBox "Please select your name from the drop down list. Favor de
> > seleccionar su nombre de la lista siguiente"
> > ElseIf DCount("ShopID", "Shoplog", "volID=" & cboName & " And
> > ShopDate=Date()") = 0 Then
> > DoCmd.RunSQL "Insert Into Shoplog (volID, ShopDate, SHOPSignin) Values("
> > & cboName & ",Date(),Time());"
> > MsgBox cboName.Column(1) & ", you have signed in successfully!"
> > cboName = Null
> > DoCmd.Close
> >
> > Else
> > MsgBox cboName.Column(1) & ", you have already signed in today! Ya se
> > ha registrado por el dia de hoy."
> >
> > End If
> >

 
Reply With Quote
 
JimS
Guest
Posts: n/a
 
      16th Sep 2009
Well, if you have option explicit set, you need to dim "result" as a variant
You also need to be sure you use the Msgbox options correctly. You didn't
show that code. I suspect a typo in that.
--
Jim


"nancy" wrote:

> Thanks for the info. I will pass it on.
>
> I typed in the message box information however I get a Comple error:
> Variable not Defined. What am I missing?
>
> "David H" wrote:
>
> > The MsgBox can be used as a function which returns a result as in
> >
> > result = MsgBox(...)
> > If result = vbYes then
> > end if
> >
> > If result = vbNo then
> > end if
> >
> > However, I would suggest going with an approach that eliminates or reduces
> > the ability of the person to sign in as somebody else. I would probably go
> > with a form whereby the user enters their phone number (or other unique
> > identifier) to select their information then clicks 'Sign-In' to actually
> > sign in. Anytime you're presenting a person with a list of options there's
> > always the possibility that they may not select the right one either
> > intentionally or by accident.
> >
> > "nancy" wrote:
> >
> > > I have a check in system for participants for of a nonprofit organization.
> > > The participants need to check in each time they come in and shop. When
> > > signing in they choose their name from a combo box and the click the sign-in
> > > button that runs to below event procedure. This works great. However some
> > > time someone else will sign-in for the participant under the participants
> > > name. I would like to modify the below event procedure that asks the
> > > following questions.
> > >
> > > Are you Sam ( the selected person). Yes or No.
> > > If Yes then sign in Sam.
> > > IF no. Are you shopping for Sam?
> > > IF Yes. Please type in your name. (I will call this the Altperson)
> > >
> > > Once the Altperson types in their name. I want the altperon name be added
> > > to Sam’s ( or the selected perons) sign-in information.
> > >
> > > Private Sub cmdSignIn_Click()
> > > If IsNull(cboName) Then
> > > MsgBox "Please select your name from the drop down list. Favor de
> > > seleccionar su nombre de la lista siguiente"
> > > ElseIf DCount("ShopID", "Shoplog", "volID=" & cboName & " And
> > > ShopDate=Date()") = 0 Then
> > > DoCmd.RunSQL "Insert Into Shoplog (volID, ShopDate, SHOPSignin) Values("
> > > & cboName & ",Date(),Time());"
> > > MsgBox cboName.Column(1) & ", you have signed in successfully!"
> > > cboName = Null
> > > DoCmd.Close
> > >
> > > Else
> > > MsgBox cboName.Column(1) & ", you have already signed in today! Ya se
> > > ha registrado por el dia de hoy."
> > >
> > > End If
> > >

 
Reply With Quote
 
Matt Williamson
Guest
Posts: n/a
 
      16th Sep 2009

"nancy" <(E-Mail Removed)> wrote in message
news:4E9796BD-1A6D-41A0-86D8-(E-Mail Removed)...
> Thanks for the info. I will pass it on.
>
> I typed in the message box information however I get a Comple error:
> Variable not Defined. What am I missing?
>


If you have Option Explicit set, you need to dimension result

Dim result as long

result = MsgBox(...)
select case result
case vbYes
'do stuff
case vbNo
'do other stuff
case Else
'do stuff if result isn't Yes or No
end select

HTH

Matt


 
Reply With Quote
 
nancy
Guest
Posts: n/a
 
      16th Sep 2009
Thanks I got it to work.

Now I am working the second part of the program.

If the person filling in as an alternate person. I would like to have it
prompt the person to type in his name. How can I do this.


ElseIf result = vbNo Then
Result1 = MsgBox("Are you signing in for " & cboName.Column(1) & "",
vbYesNoCancel)
If Result1 = vbYes Then
If DCount("ShopID", "Shoplog", "volID=" & cboName & " And
ShopDate=Date()") = 0 Then

***This is where I want it to promt the person to type in his name. and the
insert in the the talble the, date, altname, volID.***

Else: MsgBox cboName.Column(1) & ", you have already signed in
today! Ya se ha registrado por el dia de hoy."

End If
ElseIf Result1 = vbNo Then
DoCmd.Close



"JimS" wrote:

> Well, if you have option explicit set, you need to dim "result" as a variant
> You also need to be sure you use the Msgbox options correctly. You didn't
> show that code. I suspect a typo in that.
> --
> Jim
>
>
> "nancy" wrote:
>
> > Thanks for the info. I will pass it on.
> >
> > I typed in the message box information however I get a Comple error:
> > Variable not Defined. What am I missing?
> >
> > "David H" wrote:
> >
> > > The MsgBox can be used as a function which returns a result as in
> > >
> > > result = MsgBox(...)
> > > If result = vbYes then
> > > end if
> > >
> > > If result = vbNo then
> > > end if
> > >
> > > However, I would suggest going with an approach that eliminates or reduces
> > > the ability of the person to sign in as somebody else. I would probably go
> > > with a form whereby the user enters their phone number (or other unique
> > > identifier) to select their information then clicks 'Sign-In' to actually
> > > sign in. Anytime you're presenting a person with a list of options there's
> > > always the possibility that they may not select the right one either
> > > intentionally or by accident.
> > >
> > > "nancy" wrote:
> > >
> > > > I have a check in system for participants for of a nonprofit organization.
> > > > The participants need to check in each time they come in and shop. When
> > > > signing in they choose their name from a combo box and the click the sign-in
> > > > button that runs to below event procedure. This works great. However some
> > > > time someone else will sign-in for the participant under the participants
> > > > name. I would like to modify the below event procedure that asks the
> > > > following questions.
> > > >
> > > > Are you Sam ( the selected person). Yes or No.
> > > > If Yes then sign in Sam.
> > > > IF no. Are you shopping for Sam?
> > > > IF Yes. Please type in your name. (I will call this the Altperson)
> > > >
> > > > Once the Altperson types in their name. I want the altperon name be added
> > > > to Sam’s ( or the selected perons) sign-in information.
> > > >
> > > > Private Sub cmdSignIn_Click()
> > > > If IsNull(cboName) Then
> > > > MsgBox "Please select your name from the drop down list. Favor de
> > > > seleccionar su nombre de la lista siguiente"
> > > > ElseIf DCount("ShopID", "Shoplog", "volID=" & cboName & " And
> > > > ShopDate=Date()") = 0 Then
> > > > DoCmd.RunSQL "Insert Into Shoplog (volID, ShopDate, SHOPSignin) Values("
> > > > & cboName & ",Date(),Time());"
> > > > MsgBox cboName.Column(1) & ", you have signed in successfully!"
> > > > cboName = Null
> > > > DoCmd.Close
> > > >
> > > > Else
> > > > MsgBox cboName.Column(1) & ", you have already signed in today! Ya se
> > > > ha registrado por el dia de hoy."
> > > >
> > > > End If
> > > >

 
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
Message headers, attachments, and the message body may be lost in Outlook 2003 when you reply to an e-mail message that contains a References header that exceeds 1,000 bytes gbkhor Microsoft Outlook 0 4th Mar 2009 11:26 AM
Recv'g Message: Unknown message recipient(s); the message was not =?Utf-8?B?U2VuZCBPYmplY3QgQ29tbWFuZCAtIFR3byBhdHRh Microsoft Access Macros 0 29th Sep 2006 04:08 PM
"The system cannot find message text for message number 0x%1 in the message TimothyTrulis@gmail.com Windows XP Setup 0 9th Feb 2006 05:59 PM
Have message opened. Move message to a folder. Message Closes! =?Utf-8?B?c2h3aWc=?= Microsoft Outlook Discussion 1 16th Jan 2005 02:43 AM
Office XP- OUTLOOK: Format toolbar is inactive. Cannot select font, color, underline, italic, etc. This occurs in new message, forward message amd reply message. Tools, Options, Customize, selections do not change the status in the messages. Hel =?Utf-8?B?V01E?= Microsoft Outlook 3 21st Feb 2004 06:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:53 PM.