By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,036 Members | 978 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,036 IT Pros & Developers. It's quick & easy.

A few Access questions

P: n/a
Okay, I have a few questions regarding an Access database our company
has. I should first mention that I'm not that knowledgable in Access
and don't really know how to use it, but I am learning. We use Access
as a Rolodex with names and addresses of clients and vendors, so it's
made up of forms. First question: when I first open Access and the
Main Switchboard pops up and I click Enter/View Contacts it brings me
to the first entry in the database. What I want it to do is bring me
to a blank form so I don't accidentally erase valuable information.
Second question: I want Access to sort these forms by company name
instead of Contact ID or Contact Type. Is is possible to make these
changes permanent? If you wouldn't mind answering these questions as
simply as you can, I would appreciated it. I don't really understand
all the developer lingo. Thanks for any and all help!

Megan :)
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
gc**********@hotmail.com (Megan) wrote in message news:<62**************************@posting.google. com>...
Okay, I have a few questions regarding an Access database our company
has. I should first mention that I'm not that knowledgable in Access
and don't really know how to use it, but I am learning. We use Access
as a Rolodex with names and addresses of clients and vendors, so it's
made up of forms. First question: when I first open Access and the
Main Switchboard pops up and I click Enter/View Contacts it brings me
to the first entry in the database. What I want it to do is bring me
to a blank form so I don't accidentally erase valuable information.
Second question: I want Access to sort these forms by company name
instead of Contact ID or Contact Type. Is is possible to make these
changes permanent? If you wouldn't mind answering these questions as
simply as you can, I would appreciated it. I don't really understand
all the developer lingo. Thanks for any and all help!

Megan :)


Megan,

One way to keep from accidentally erasing information on your Rolodex
Form is to have a button that unlocks the fields for editing and
another button that locks them. Design your form with the boxes
starting out locked.

Code to lock all the textboxes and comboboxes on a form (put behind
the command button to Lock OnClick event):

Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then
Controls(ctl.Name).Locked = True
End If
Next ctl

Post back if you really need to implement the "Blank Form" method.

In order to sort by Contact ID or Contact Type, try using Toggle
Buttons. Put code in the Toggle Button to change the RecordSource SQL
for the Form, to untoggle the other button and to ignore a click if it
is already down. Have the Toggle Button that represents the sort used
by default start in the Down position and the other one in the Up
position. Also, have the form requery itself (Me.Requery) in the
Toggle Button code to reflect the new sort. Post back if you need more
details about how to do any of this.

Hope this helps,
James A. Fortune
Nov 13 '05 #2

P: n/a
Yes, I'm definately going to need more explanation on doing these.
Maybe a step-by-step explanation would be good. Honestly, I don't know
anything about Access, other than entering information into an already
created database. I appreciate your help and it sounds like you have
the answers to my problems. Thanks.

Megan :)


ja******@oakland.edu (James Fortune) wrote in message news:<a6**************************@posting.google. com>...
Megan,

One way to keep from accidentally erasing information on your Rolodex
Form is to have a button that unlocks the fields for editing and
another button that locks them. Design your form with the boxes
starting out locked.

Code to lock all the textboxes and comboboxes on a form (put behind
the command button to Lock OnClick event):

Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then
Controls(ctl.Name).Locked = True
End If
Next ctl

Post back if you really need to implement the "Blank Form" method.

In order to sort by Contact ID or Contact Type, try using Toggle
Buttons. Put code in the Toggle Button to change the RecordSource SQL
for the Form, to untoggle the other button and to ignore a click if it
is already down. Have the Toggle Button that represents the sort used
by default start in the Down position and the other one in the Up
position. Also, have the form requery itself (Me.Requery) in the
Toggle Button code to reflect the new sort. Post back if you need more
details about how to do any of this.

Hope this helps,
James A. Fortune

Nov 13 '05 #3

P: n/a
gc**********@hotmail.com (Megan) wrote in message news:<62**************************@posting.google. com>...
Yes, I'm definately going to need more explanation on doing these.
Maybe a step-by-step explanation would be good. Honestly, I don't know
anything about Access, other than entering information into an already
created database. I appreciate your help and it sounds like you have
the answers to my problems. Thanks.

Megan :)


To start the textboxes and comboboxes as locked, highlight all the
textboxes and comboboxes only and then use the View menu to look at
the Properties. You should get a 'Multiple selection' properties box.
Click the 'All' tab and look for the 'Locked' property. Set this to
'True.' Use the Toolbox Icon to create a new command button but hit
cancel when the wizard comes up. Change the name to 'cmdLock' and the
Caption to 'Lock.' Click the 'Event' tab. Click to the right of
'OnClick' then click on the three dots to the far right. When the
'Choose Builder' window comes up select 'Code Builder', then click OK
(or just double click on Code Builder). Paste the lock code right
where the cursor is. Close the code and properties windows and do the
same for unlock, remembering to change the "True" in the code to
"False." Now create a toggle button. Call its name tglID. For its
Caption put in 'Sort By ID.' To the right of the Default property put
-1. For its OnClick code put in:

If tglID.Value = 0 Then Exit Sub
tglType.Value = 0
tglCompanyName.Value = 0
Me.RecordSource = "SELECT * FROM tblContacts ORDER BY ID;"
Me.Requery

Make sure the Form Property 'Record Source' starts with the one above.
Create another toggle button called tglType with Caption 'Sort By
Type.' To the right of the Default property put 0. In its OnClick
code put:

If tglType.Value = 0 Then Exit Sub
tglID.Value = 0
tglCompanyName.Value = 0
Me.RecordSource = "SELECT * FROM tblContacts ORDER BY Type;"
Me.Requery

And finally, cmdCompanyName w/ 'Sort By Co. Name' Caption and Default
= 0:

If tglCompanyName.Value = 0 Then Exit Sub
tglID.Value = 0
tglType.Value = 0
Me.RecordSource = "SELECT * FROM tblContacts ORDER BY CompanyName;"
Me.Requery

Your three toggle buttons will change the form sort order. Note that
the form will display the first record of the sort when you change the
sort.

James A. Fortune
Nov 13 '05 #4

P: n/a
Thanks for your help. This has worked great.

Megan :)


ja******@oakland.edu (James Fortune) wrote in message news:<a6**************************@posting.google. com>...

To start the textboxes and comboboxes as locked, highlight all the
textboxes and comboboxes only and then use the View menu to look at
the Properties. You should get a 'Multiple selection' properties box.
Click the 'All' tab and look for the 'Locked' property. Set this to
'True.' Use the Toolbox Icon to create a new command button but hit
cancel when the wizard comes up. Change the name to 'cmdLock' and the
Caption to 'Lock.' Click the 'Event' tab. Click to the right of
'OnClick' then click on the three dots to the far right. When the
'Choose Builder' window comes up select 'Code Builder', then click OK
(or just double click on Code Builder). Paste the lock code right
where the cursor is. Close the code and properties windows and do the
same for unlock, remembering to change the "True" in the code to
"False." Now create a toggle button. Call its name tglID. For its
Caption put in 'Sort By ID.' To the right of the Default property put
-1. For its OnClick code put in:

If tglID.Value = 0 Then Exit Sub
tglType.Value = 0
tglCompanyName.Value = 0
Me.RecordSource = "SELECT * FROM tblContacts ORDER BY ID;"
Me.Requery

Make sure the Form Property 'Record Source' starts with the one above.
Create another toggle button called tglType with Caption 'Sort By
Type.' To the right of the Default property put 0. In its OnClick
code put:

If tglType.Value = 0 Then Exit Sub
tglID.Value = 0
tglCompanyName.Value = 0
Me.RecordSource = "SELECT * FROM tblContacts ORDER BY Type;"
Me.Requery

And finally, cmdCompanyName w/ 'Sort By Co. Name' Caption and Default
= 0:

If tglCompanyName.Value = 0 Then Exit Sub
tglID.Value = 0
tglType.Value = 0
Me.RecordSource = "SELECT * FROM tblContacts ORDER BY CompanyName;"
Me.Requery

Your three toggle buttons will change the form sort order. Note that
the form will display the first record of the sort when you change the
sort.

James A. Fortune

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.