473,396 Members | 1,927 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,396 software developers and data experts.

Quick, simple question with Access Database Form

Hello All,

I have a quick, easy question. Hopefully, someone will give me a hint.
I will greatly appreciate any help. I am pretty new to Access.
I have created a Main Menu in Form in Access. When I click on Main
Menu, an interface popups. In the interface, I have 2 buttons. For
example:

--------------------------------------------------------|
| |
| |--------------------| |
| | House Info | |
| |-------------------- |
| |
| |--------------------| |
| | Car Info | |
| |-------------------- |
|
| |
--------------------------------------------------------

What I have to do is that: when I click on button "House Info" then a
window pops up, asking for password. After that, it will go to another
interface for the user to enter/update their House information. When
someone clicks on "Car Info" button, there is no window pops up asking
for password, it just goes directly to its own interface for user to
enter information about their car.

If you have any idea how to do this, please give me a hint. Thank you
so very much for your help.

Sincerely,
Teresa

Nov 13 '05 #1
4 1527
On 29 Sep 2005 17:02:18 -0700, "motessa" <le******@yahoo.com> wrote:

In the Click even for the HouseInfo button write:
If InputBox("Enter the password") = "secret" then
docmd.openform "EnterUpdateHouseInfo"
end if

In the click event for the other button (which you could have created
if you had used the wizard), the code would be:
docmd.openform "EnterUpdateCarInfo"

Of course you have to replace the password and form names by the
actual ones used in your app.

-Tom.
Hello All,

I have a quick, easy question. Hopefully, someone will give me a hint.
I will greatly appreciate any help. I am pretty new to Access.
I have created a Main Menu in Form in Access. When I click on Main
Menu, an interface popups. In the interface, I have 2 buttons. For
example:

--------------------------------------------------------|
| |
| |--------------------| |
| | House Info | |
| |-------------------- |
| |
| |--------------------| |
| | Car Info | |
| |-------------------- |
|
| |
--------------------------------------------------------

What I have to do is that: when I click on button "House Info" then a
window pops up, asking for password. After that, it will go to another
interface for the user to enter/update their House information. When
someone clicks on "Car Info" button, there is no window pops up asking
for password, it just goes directly to its own interface for user to
enter information about their car.

If you have any idea how to do this, please give me a hint. Thank you
so very much for your help.

Sincerely,
Teresa


Nov 13 '05 #2
Hi Tom,

Thanks very much for your help. It gave me a wonderful tip in solving
this problem.

The only issue I have is that when the box pops up asking for password,
if I click on the "Cancel" button,
it will go directly to the next interface for the user to enter their
house information, and also if the user enters the wrong password, it
still goes directly to the next interface. Here is what I have in the
Click Event:

Private Sub Condition_Data_Setting_Click()

If InputBox("Enter the password") = "test" Then
DoCmd.OpenForm "EnterUpdateHouseInfo"
End If

On Error GoTo Err_Condition_Data_Setting_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "1-CONDITION SETTING"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Condition_Data_Setting_Click:
Exit Sub

Err_Condition_Data_Setting_Click:
MsgBox Err.Description
Resume Exit_Condition_Data_Setting_Click

End Sub

--- In my real app, the button is called : "Condition Data Setting".
I will try to change the code to make it work, if you see the reason
why, please drop me a line. Thank you so very much in answering me
question.

Sincerely,
Teresa

Nov 13 '05 #3
On 30 Sep 2005 08:33:16 -0700, "motessa" <le******@yahoo.com> wrote:

Perhaps this would work: ensure that all code gets executed in the
"If" condition:

Private Sub Condition_Data_Setting_Click()
On Error GoTo Err_Condition_Data_Setting_Click
Dim stDocName As String
Dim stLinkCriteria As String

If InputBox("Enter the password") = "test" Then
DoCmd.OpenForm "EnterUpdateHouseInfo"

stDocName = "1-CONDITION SETTING"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If

Exit_Condition_Data_Setting_Click:
Exit Sub

Err_Condition_Data_Setting_Click:
MsgBox Err.Description
Resume Exit_Condition_Data_Setting_Click
End Sub

If you want the first form to be finished before we get to the second
one, use a modal form:
DoCmd.OpenForm "EnterUpdateHouseInfo",,,,acDialog
You'll need to check the number of comma's here, but there is an
argument that allows you to specify that the form should be opened
modally. The line "stDocName = ..." won't execute until the form
closes.

-Tom.


Hi Tom,

Thanks very much for your help. It gave me a wonderful tip in solving
this problem.

The only issue I have is that when the box pops up asking for password,
if I click on the "Cancel" button,
it will go directly to the next interface for the user to enter their
house information, and also if the user enters the wrong password, it
still goes directly to the next interface. Here is what I have in the
Click Event:

Private Sub Condition_Data_Setting_Click()

If InputBox("Enter the password") = "test" Then
DoCmd.OpenForm "EnterUpdateHouseInfo"
End If

On Error GoTo Err_Condition_Data_Setting_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "1-CONDITION SETTING"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Condition_Data_Setting_Click:
Exit Sub

Err_Condition_Data_Setting_Click:
MsgBox Err.Description
Resume Exit_Condition_Data_Setting_Click

End Sub

--- In my real app, the button is called : "Condition Data Setting".
I will try to change the code to make it work, if you see the reason
why, please drop me a line. Thank you so very much in answering me
question.

Sincerely,
Teresa


Nov 13 '05 #4
Thanks so much for your reply, Tom. I am almost finished with this. You
are a great help. I hope somebody will help you in your time of need as
much as you help me.

Sincerely,
Teresa

Nov 13 '05 #5

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

Similar topics

0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.