[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

help

Posted on 2001-06-12
5
Medium Priority
?
178 Views
Last Modified: 2010-05-03
hi all,

how to provide  hot keys to controls using default in option group and default command button

and  donot  do calculation  unless  the user  has entered  customer name .and donot  produce receipt unless user has done calculation
0
Comment
Question by:nanu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 9

Accepted Solution

by:
Valliappan AN earned 200 total points
ID: 6181053
For command buttons and option buttons, you could set the caption property with a & sign before the letter with which you need to give the shortcut key for the button.

E.g.

cmdOK button, caption could be "&OK". So that, its shortcut key will be Alt+O for the user.

Similar for the option buttons. Say, if the caption is
"Customer" you could set it like: "C&ustomer", for setting Alt+u as shortcut key.

Put the customer name validation code in the customer name text box validate event. Similarly for other events like:

Private Sub txtCustName_Validate(Cancel As Boolean)
   If Len(txtCustName) = 0 Then
      Msgbox "Invalid Customer Name."
      Cancel = True
   End If
End Sub

Have a form level variable, for calculation, and if the user does the calculation set it to True or else it remain False.

You could check this variable in the cmdOK_Click event, before doing the further processing.

Private Sub cmdOk_Click()
   If mCalculate = False
      Msgbox "Calculation Not Done."
      Exit Sub
   End If
   :
   'your processing code goes here
End Sub

Set your Cancel button(if at all you have)'s CausesValidation property to False, so that the user could be able to cancel the operation without saving and quit out.

Hope this helps,
Cheers.
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6181058
And, in option groups, to set something to default, set one of the option button's value to true, in design time, or in Form_Load event.

0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7135948
Hi nanu,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept valli_an's comment(s) as an answer.

nanu, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7173217
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

649 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