473,699 Members | 3,186 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combo box, command button placement questions

A couple of easy questions here hopefully. I've been working on two
different database projects which make use of multiple
forms.

1. Where's the best/recommended placement for command buttons for things
like delete, save, edit, cancel buttons - in the footer, or on the form
detail section?

2. If in the footer, how do you add them to the tab order?

3. I open all forms with allow{additions ,deletions,edit s} turned off. I
want to be able to add a combo box to one form which will allow the user
to select a record from the combo box. I've added the combo box with no
problem, but the user can only select a record if allowedits is on. Is
there a way to allow this, yet still retain data protection by not
allowing edits?

Thanks,

Kevin
Jan 14 '06 #1
14 4968
Answers in-line.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Kevin" <wi******@hotma il.com> wrote in message
news:pa******** *************** ****@hotmail.co m...
A couple of easy questions here hopefully. I've been working on two
different database projects which make use of multiple
forms.

1. Where's the best/recommended placement for command buttons for
things like delete, save, edit, cancel buttons - in the footer, or on the
form detail section?
In the Toolbar.

A command button on the form for Cancel is very frustrating. The events of
the control where the user is making an entry fire before Access moves the
focus to the command button and its events fire. That means the Cancel
button cannot solve problems such as:
- a partial date e.g. 1/12/
- a value that was backspaced out in a required field.
- a combo value that is not in the list
and so on. In general, a Cancel button on the form causes more problems that
it solves.

A Save button on the form is superfluous. Access saves automatically, and
you don't want to slow users down by having them click a superfluous button
every record.

A Delete button has the same problems as an Undo.

An Lock/Unlock button does make sense if the record is locked for editing.

If you choose to use command buttons anyway, it is a question of style what
section you place them in.
2. If in the footer, how do you add them to the tab order?
Place a small unbound text box in the Detail section of the form, as the
last one in the tab order. In its GotFocus event, SetFocus to the first
command button in the Form Footer section.
3. I open all forms with allow{additions ,deletions,edit s} turned off. I
want to be able to add a combo box to one form which will allow the user
to select a record from the combo box. I've added the combo box with no
problem, but the user can only select a record if allowedits is on. Is
there a way to allow this, yet still retain data protection by not
allowing edits?


That's right. If the form's AllowEdits is set to No, even the unbound
contorls are unusable. To avoid this, you need to set the Locked property of
each bound controls instead of the AllowEdits of the form.

To do that check out this article:
Locking bound controls on a form and subforms
at:
http://allenbrowne.com/ser-56.html
The article contains code that loops through all bound controls on the form,
and toggles their Locked property. If it finds a subform on the form, the
code calls itself recursively, so that subforms are also locked/unlocked to
any depth. If there is a control you do not want to unlock, you can name it
in the exception list. (If you don't want to lock subforms, that means you
can name them in the exception list.)

BTW, if you set AllowAdditions to No, you get another problem. If the form
is filtered so that it has no records, the Detail section goes completely
blank, and even the unbound contorls in the Form Header or Form Footer are
likely to play up as described here:
http://allenbrowne.com/bug-06.html
To avoid that issue, you might like to leave AllowAdditions as Yes, but
cancel the form's BeforeInsert event if the user tries to add a record while
the form is not in your edit state.
Jan 14 '06 #2

On Sat, 14 Jan 2006 12:52:57 +0800, Allen Browne wrote:
Answers in-line.

"Kevin" <wi******@hotma il.com> wrote in message
news:pa******** *************** ****@hotmail.co m...
A couple of easy questions here hopefully. I've been working on two
different database projects which make use of multiple
forms.

1. Where's the best/recommended placement for command buttons for
things like delete, save, edit, cancel buttons - in the footer, or on the
form detail section?
In the Toolbar.


Heh, I agree. However for novice users I could see this becoming a
problem. If there's not a big "go" button, they tend to get lost. ;)

A command button on the form for Cancel is very frustrating. The events
of the control where the user is making an entry fire before Access
moves the focus to the command button and its events fire. That means
the Cancel button cannot solve problems such as: - a partial date e.g.
1/12/
- a value that was backspaced out in a required field. - a combo value
that is not in the list and so on. In general, a Cancel button on the
form causes more problems that it solves.
Good information, thanks.

A Save button on the form is superfluous. Access saves automatically,
and you don't want to slow users down by having them click a superfluous
button every record.

True, my save buttons are usually a coded method to Allow{Edits,
Deletions, Additions}. They don't really "save", but rather lock
everything back up and present the user with other options.
A Delete button has the same problems as an Undo.

An Lock/Unlock button does make sense if the record is locked for
editing.

Again, that's really what my buttons do. The delete button enabled
edits/deletions, calls EditMenu 8 and 6, and then locks things back up.

If you choose to use command buttons anyway, it is a question of style
what section you place them in.
2. If in the footer, how do you add them to the tab order?
Place a small unbound text box in the Detail section of the form, as the
last one in the tab order. In its GotFocus event, SetFocus to the first
command button in the Form Footer section.


Nice solution!
3. I open all forms with allow{additions ,deletions,edit s} turned off. I
want to be able to add a combo box to one form which will allow the
user to select a record from the combo box. I've added the combo box
with no problem, but the user can only select a record if allowedits is
on. Is there a way to allow this, yet still retain data protection by
not allowing edits?


That's right. If the form's AllowEdits is set to No, even the unbound
contorls are unusable. To avoid this, you need to set the Locked
property of each bound controls instead of the AllowEdits of the form.


That's what I was experimenting with today. But that causes other
problems like re-assigning the current record with whatever you select in
the combo box. :\
To do that check out this article:
Locking bound controls on a form and subforms
at:
http://allenbrowne.com/ser-56.html
The article contains code that loops through all bound controls on the
form, and toggles their Locked property. If it finds a subform on the
form, the code calls itself recursively, so that subforms are also
locked/unlocked to any depth. If there is a control you do not want to
unlock, you can name it in the exception list. (If you don't want to
lock subforms, that means you can name them in the exception list.)

BTW, if you set AllowAdditions to No, you get another problem. If the
form is filtered so that it has no records, the Detail section goes
completely blank, and even the unbound contorls in the Form Header or
Form Footer are likely to play up as described here:
http://allenbrowne.com/bug-06.html
To avoid that issue, you might like to leave AllowAdditions as Yes, but
cancel the form's BeforeInsert event if the user tries to add a record
while the form is not in your edit state.


Thanks for the link, I'll check out the pages!

Aloha,

Kevin
Jan 14 '06 #3
Hey, I did assume this was an unbound combo, purely for the purpose of
selecting the record to navigate to.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Kevin" <wi******@hotma il.com> wrote in message
news:pa******** *************** *****@hotmail.c om...
... If the form's AllowEdits is set to No, even the unbound
contorls are unusable. To avoid this, you need to set the Locked
property of each bound controls instead of the AllowEdits of the form.


That's what I was experimenting with today. But that causes other
problems like re-assigning the current record with whatever you select in
the combo box. :\

Jan 14 '06 #4
On Sat, 14 Jan 2006 17:33:45 +0800, Allen Browne wrote:
Hey, I did assume this was an unbound combo, purely for the purpose of
selecting the record to navigate to.


Well, it has to be set to the particular field value, so are you saying
use a query instead of binding it to a table value? Or how else would I
have it unbound?
Jan 14 '06 #5
Kevin wrote:
On Sat, 14 Jan 2006 17:33:45 +0800, Allen Browne wrote:
Hey, I did assume this was an unbound combo, purely for the purpose
of selecting the record to navigate to.


Well, it has to be set to the particular field value, so are you
saying use a query instead of binding it to a table value? Or how
else would I have it unbound?


ComboBoxes are typically used either as a means to enter data in a field (bound)
or to navigate to a record (unbound). You can't use one to do both things at
the same time.

When you open the form to Record one and a bound ComboBox has a particular value
in it then changing the ComboBox selection is altering the first record. If
your intended use was to move to another record then this would obviously be
incorrect.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Jan 14 '06 #6
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in
news:43******** *************** @per-qv1-newsreader-01.iinet.net.au :
"Kevin" <wi******@hotma il.com> wrote in message
news:pa******** *************** ****@hotmail.co m...
A couple of easy questions here hopefully. I've been working on
two
different database projects which make use of multiple
forms.

1. Where's the best/recommended placement for command buttons for
things like delete, save, edit, cancel buttons - in the footer,
or on the form detail section?
In the Toolbar.


I strongly disagree with this response in general.

Dialog boxes *must* have their command buttons on the form, since
the toolbars are not accessible when a form is open with acDialog.

Secondly, all Windows dialogs have a Cancel button *on* the form.

Puttin it anywhere else will be confusing. Personally, I can't think
of a single instance of a CANCEL button in a toolbar. Well,
actually, I can think of one, and the reason I remember it is
because it'annoys the hell out of me every time I encounter it, and
that's in the PRINT PREVIEW in MS Office programs. Fortunately, the
ESCAPE key is mapped to it, so I just hit ESCAPE.
A command button on the form for Cancel is very frustrating. The
events of the control where the user is making an entry fire
before Access moves the focus to the command button and its events
fire. That means the Cancel button cannot solve problems such as:
- a partial date e.g. 1/12/
- a value that was backspaced out in a required field.
- a combo value that is not in the list
and so on. In general, a Cancel button on the form causes more
problems that it solves.
These problems would easily solved with a flag that the events of
those controls could check before executing their code. This flag
would be set in the Cancel buttons OnClick event.

However, let me note: I've never done it, and I have never even once
put a cancel button on a toolbar, but always on forms.

And I've never encountered any such problems.

Ever.

In 10 years of full-time Access programming.
A Save button on the form is superfluous. Access saves
automatically, and you don't want to slow users down by having
them click a superfluous button every record.
Many things in user interface design are, strictly speaking,
superfluous in that they duplicate functionality found elsewhere.

A SAVE button is clear and easy to see and tells the user how to
save a record, which they won't know if they haven't studied the
Access documentation. It gives them security to know that the record
is saved, even if that is only a psychological issue. We are dealing
with people here, so their comfort levels with their applications is
relevant to providing a satisfactory user experience.
A Delete button has the same problems as an Undo.
What would those problems be?
An Lock/Unlock button does make sense if the record is locked for
editing.

If you choose to use command buttons anyway, it is a question of
style what section you place them in.
With all due respect, I think your advice is completely ridiculous.
I've never seen apps of any kind, Access or not, built the way you
recommend. You are calling for creating apps that depart from the
conventions of all the apps I can think of, which would likely lead
to user dissatisfaction , and make the apps harder to learn (though
only in the first few hours of use).

The problems that you adduce are actually quite easily solved (at
least the ones you chose to explain), so I really don't see any
justification at all to use such a user-unfriendly interface design.
2. If in the footer, how do you add them to the tab order?


Place a small unbound text box in the Detail section of the form,
as the last one in the tab order. In its GotFocus event, SetFocus
to the first command button in the Form Footer section.


Or, don't use footers.

The only reason to use footers is if you have a multipage form (a
footer keeps its contents in the same location regardless of which
page you are on), and since Access started incorporating a tab
control (in A97) there is no longer any justification for a
multipage form, in my opinion. Multipage forms are user-unfriendly
because the vertical location of controls becomes random. Location
of controls should always be constant, never shifting around, and
there is no way to do that in a multipage form without a massive
amount of extra coding.

So, the way to avoid the problem of independent tab order in footers
is to simply not use footers, unless an independent tab order for
some controls would be useful.
3. I open all forms with allow{additions ,deletions,edit s} turned
off. I want to be able to add a combo box to one form which will
allow the user to select a record from the combo box. I've added
the combo box with no problem, but the user can only select a
record if allowedits is on. Is there a way to allow this, yet
still retain data protection by not allowing edits?


That's right. If the form's AllowEdits is set to No, even the
unbound contorls are unusable. To avoid this, you need to set the
Locked property of each bound controls instead of the AllowEdits
of the form.

To do that check out this article:
Locking bound controls on a form and subforms
at:
http://allenbrowne.com/ser-56.html


I think this code would be made much more efficient if you used a
custom collection for locking/unlocking the controls. If you are
locking/unlocking the form repeatedly, the performance improvment
with a custom collection is actually quite noticeable to the user. I
was surprisde at this, myself, but found it to be quite true even on
forms that didn't have 100+ controls.
The article contains code that loops through all bound controls on
the form, and toggles their Locked property. If it finds a subform
on the form, the code calls itself recursively, so that subforms
are also locked/unlocked to any depth. . . .
Why would you not just disable the subform control and be don with
it?
. . . If there is a control you do not want to unlock, you can
name it in the exception list. (If you don't want to lock
subforms, that means you can name them in the exception list.)
I use Tag properties to indicate how I want controls to be handled
in this type of initialize routines.
BTW, if you set AllowAdditions to No, you get another problem. If
the form is filtered so that it has no records, the Detail section
goes completely blank, and even the unbound contorls in the Form
Header or Form Footer are likely to play up as described here:
http://allenbrowne.com/bug-06.html
To avoid that issue, you might like to leave AllowAdditions as
Yes, but cancel the form's BeforeInsert event if the user tries to
add a record while the form is not in your edit state.


I don't quite understand that recommendation. Why doesn't locking
the controls so that they are uneditable make it impossible to add
new records without clicking a command button to do so? If you have
the form navigation set to stay in the same record and trap for the
Page Down key, you could leave AllowAdditions on and not worry about
it.

Second, in your OnCurrent, if Me.NewRecord = True, you'd unlock the
appropriate controls.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Jan 14 '06 #7
On Sat, 14 Jan 2006 19:38:27 +0000, Rick Brandt wrote:
Kevin wrote:
On Sat, 14 Jan 2006 17:33:45 +0800, Allen Browne wrote:
> Hey, I did assume this was an unbound combo, purely for the purpose of
> selecting the record to navigate to.


Well, it has to be set to the particular field value, so are you saying
use a query instead of binding it to a table value? Or how else would I
have it unbound?


ComboBoxes are typically used either as a means to enter data in a field
(bound) or to navigate to a record (unbound). You can't use one to do
both things at the same time.


OK, maybe I wasn't clear. I don't want to do both, I want to use it to
navigate records. Currently it's bound since I used the form wizard to
select the field. I'll have to do some poking around.
Jan 14 '06 #8
It's dead easy to create another combo for navigation purposes.
Just make sure its Control Source property is No.

Or follow the steps in this article:
Using a Combo Box to Find Records
at:
http://allenbrowne.com/ser-03.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Kevin" <wi******@hotma il.com> wrote in message
news:pa******** *************** ****@hotmail.co m...
On Sat, 14 Jan 2006 19:38:27 +0000, Rick Brandt wrote:
Kevin wrote:
On Sat, 14 Jan 2006 17:33:45 +0800, Allen Browne wrote:

> Hey, I did assume this was an unbound combo, purely for the purpose of
> selecting the record to navigate to.

Well, it has to be set to the particular field value, so are you saying
use a query instead of binding it to a table value? Or how else would I
have it unbound?


ComboBoxes are typically used either as a means to enter data in a field
(bound) or to navigate to a record (unbound). You can't use one to do
both things at the same time.


OK, maybe I wasn't clear. I don't want to do both, I want to use it to
navigate records. Currently it's bound since I used the form wizard to
select the field. I'll have to do some poking around.

Jan 15 '06 #9
David, as always, the opinion of a seasoned Access developer like yourself
is welcome, and is very helpful for the original poster to get different
opinions, representing different styles.

Responses to the first part of your reply in-line. Hopefully that's enough
to explain the mindset behind the recommendations .

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"David W. Fenton" <XX*******@dfen ton.com.invalid > wrote in message
news:Xn******** *************** ***********@127 .0.0.1...
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in
news:43******** *************** @per-qv1-newsreader-01.iinet.net.au :
"Kevin" <wi******@hotma il.com> wrote in message
news:pa******** *************** ****@hotmail.co m...

1. Where's the best/recommended placement for command buttons for
things like delete, save, edit, cancel buttons - in the footer,
or on the form detail section?
In the Toolbar.


I strongly disagree with this response in general.

Dialog boxes *must* have their command buttons on the form, since
the toolbars are not accessible when a form is open with acDialog.


If you open bound forms in dialog mode, then your point is valid.
Personally, I do that only when absolutely necessary. Probably 19 our to 20
of the forms I create are opened in normal mode, so the user can go
anywhere, do anything, at any time, in any order. Each form's AfterUpdate
and AfterDelConfirm events keep any open forms up to date. IME, even users
who have little computer experience love this flexibility, and adapt to it
very quickly.

Essentially it's just an event-driven mindset instead of a procedural
mindset. I usually have no idea what procedural order a user will follow to
achieve a result, and often find they take creative paths that I never
considered. The one thing I do teach them is that they can double-click any
combo to get at the data behind that list, to find, add, edit, or delete the
list. Some of them launch the target (e.g. to make an invoice) and never
bother with the switchboard again in that session, using this drill-down to
go anywhere else they want to go.
Secondly, all Windows dialogs have a Cancel button *on* the form.


As I develop, a dialog is something completely different than a normal bound
form. You must deal with it before you can go anywhere else. The choices you
are forced to take are therefore appropriately on the form.

What users call a "Cancel" button, is actually an Undo button, and Access
itself puts one of those on the toolbar, just like the other Office
applications.
Jan 15 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3725
by: Daniel Hill | last post by:
OK, I have very, VERY basic background knowledge of VB6 and have now upgraded to VB.NET and now I'm struggling to bring up the forms I want. What I am looking to do is to have a click a command button bring up a form, and to have which form is brought up determined by which item is selected in the accompanying combo box. I've gathered that you have to declare the item as a
3
2388
by: Paul | last post by:
hi, can someone give me an idea how to do this: i have a combo box and a command button, "Go", next to it. the combo box is displaying the "Person Name" from a table with "ID" and "Person Name". When I click "Go" i want to open a form associated with the current display on the combo box. Thank you in advace.
3
11069
by: pelcovits | last post by:
I am trying to set up an unbound form to enter report criteria. I've followed the MS Office Assistance document: "Create a form to enter report criteria" which describes how to enter data (such as dates) in a text box. This procedure works fine. However, I also need to enter data from a combo box and I cannot get this to work. On my form I've created an unbound combo box named "Name". In the query bound to the report I've entered the...
1
11829
by: meganrobertson22 | last post by:
Hi Everyone- I am trying to use a simple macro to set the value of a combo box on a form, and I can't get it to work. I have a macro with 2 actions: OpenForm and SetValue. I can open my form, but I can't get the macro to set the value of a combo box on the form that opens. I don't need the macro to look up any values, I just want it to set the value of a combo box.
4
7183
by: meganrobertson22 | last post by:
Hi Everyone- I have a question about how to add and then use the "All" selection in a combo box. I am trying to figure out how to: (1) add "All" as a selection to a combo box and then (2) how to use the selection "All" as criteria for a field in a query, which is used to generate data for a report.
6
12471
by: fieldja | last post by:
I have a form called OwnerForm. It contains a combo box called Owner. The combo box looks up names from a table called OwnerName. It contains fields called OwnerID and Owner. I also have a main form called ProjectsForm. This form has several fields to enter data. I have a query that is called Owner Query. This query contains the fields IDNumber.Projects2 Team.Projects2 and Owner.OwnerName getting information from tables. On the...
28
3259
by: jverri01 | last post by:
First, I am relatively new to working with variables. Most of my experience has been with interface design. i am using ACCESS ver. 2003, running in Windows XP. Second, I spent an hour searching through articles and posts to make sure the information I am seeking is not already posted on the site. I am beating my head against the wall trying to figure out something that seems like it should be very simple. The trouble is I do not fully...
2
4417
by: iamdennis | last post by:
Hi all. I stuck here and need some help. I have created a combo box which contains a list of links to external PDF files. I also created a OPEN command button next to the combo box. I want to be able to select a file from the list and use the command button to open this external PDF file. I already know how to use just a command button to open an external file. However, it is very time consuming to use command buttons when you have...
3
5514
by: WiscCard | last post by:
This seems simple enough, but I am having problems. I have a table of customer information. I have a form with various combo boxes displaying unique customer information (in this case, zone and broker, but I'll add others before it is done. I want each user to choose what they want out of the combo boxes, then hit the command button, which will display the results on a customized form. If they choose both combo boxes, it works gerat. The...
0
8704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8623
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9053
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8936
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8894
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7776
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3071
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.