473,320 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

A few Access questions

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
4 1960
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dale Ring | last post by:
Access 2000 I am trying to print a report that only some of the records have pictures. When the report prints, I do not want a blank image control showing on the report. This project is a test...
1
by: Stefan V. | last post by:
Hello! I am trying to convert a query written for SQL Server 2000 database tables, to a MS Access query. Here is what I have in SQL Server: SELECT t2.*, CASE WHEN t2.QType = '3' THEN...
3
by: krygsma | last post by:
So, I need to figure out how to do what I want to do with Access. I have many questions with mutually exclusive options, each option has a value, never=0, few times=1...ect.. (then when questions...
7
by: Ariel | last post by:
I have a question that I'm hoping someone here can answer. Let's say I have two fields which have a beginning number and an ending number. What I'd like to do is have Access generate a list of...
42
by: PC Datasheet | last post by:
I have zero experience with using a SQL database for a backend and Access for a frontend. I have some questions: 1. Does an SQL database have tables? 2. How does Access connect to the data in...
0
by: totierne | last post by:
comp.databases.ms-access, I want to know how to use Oracle views with session variables in Access. The parameterised views in access, are migrated to views with per session variables. The...
4
by: Grant Austin | last post by:
Hello, This might be a tad off topic. The c-programming groups I found appear to be unused... The problem is simple... I need to create a listing file from an assembler source file. The...
7
by: Martin Strojek | last post by:
Hi, I have the following problem with developing some web site. I use Visual Studio 2003 to build a website. I tried Windows 2003 Server and switched now back to Windows XP with PWS but the...
62
by: Ecohouse | last post by:
I was just wondering if there was any way to use a toolbar in Outlook 2002 in Access 2002? I want to create a custom toolbar in Access similar to the Calendar toolbar in Outlook. Any ideas?
21
by: Bigpond News | last post by:
Work at a large site - 1000+ PC's. Mixture of Win98 & WinXP. Majority of applications using Access 97. If I compile the Acc97 application on a Win98 PC, the .mde will run perfectly on both...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.