I Need Help

yessir

Saved By Grace
Local time
Today, 05:42
Joined
May 29, 2003
Messages
349
I Need Help, Where have all the experts gone, long time passing!

OK,

i know i posted this before, but i REALLY need a good answer here. I have a switchboard, and it has a staff and a visitor selection. The visitor can be anyone and is unrestricted. The staff can ONLY get into the staff part based on a password and name.

if the user clicks Staff, a form opens and asks for their name and password, and cannot click off it unless they enter a proper password or cancel. If the cancel it stays at the main switchboard page. BUT if they enter the right code i then want the Switchboard to open to the staff selections.

Thus setting visibility won't work properly.

I REALLY need an answer here, detailed an working. (PLZ :))

I am kinda simple i guess...

i also tried to cut away all the extra to post an example, but it won't compress enuf to load, so here are screen shots...
 

Attachments

Last edited:
Question, why not just open a second form instead?
Visibility should work, always has for me.
You could use frames with your selections and hide or show depending on what you want.
 
am i able to do a

am i able to do a

docmd.close

on a specific form?

an in when a certain form loads another is shut?
 
Access has it's own secret way of dealing with switchboards.
If you look behind the on_Click event of the controls, it has reference to a myserious HandleClick (or something similar) function that I have never been able to find and therefore do not know what parameters to send it!

I think if you have set up a switchboard for the staff details, maybe this will work.

on the exit of your password form, open the relevant switchboard, ie


rest of code to process password....
HandleClick(1) 'or whatever it is - look on the original switchboard form.

I know it's a bit fuzzy but I do not have Access in front of me at the moment!
 
This is pretty simple, but what I do is either create a macro that opens a form and closes another, name it mcrOpenXCloseY, then in the form control button, set the OnClick property to that macro. Or you could do one macro to just close the form, then in your control button properties, set the OnClick to the macro, and hyperlink to the new form. If you have more than one button on a form, you can use the macroClose for each of them.
 
on my time off line i have become self dependant

I simply close the switchboard when it opens the form, and then when the password is ok it closes the form and opens the switchboard for staff, and la la la , anyway, it may not be pretty but it works:D
 
I couldn't resist your opening:
"Where have all the experts gone, long time passing!" We must be of the same generation!

Just as a general comment on switchboards: On this side of the Pond (I'm from Richmond,Virginia, not Yorkshire!) we pretty much Deep Six switchboards. They just seem to add more complications to an already complicated situation. Instead we simply use forms. If "Visitor" is selected on "MainForm", goto "VisitorsForm". If "Staff" is selected, goto "StaffSignInForm". If input is correct here, goto "StaffForm"; if incorrect, goto "MainForm" again.

You can close one form when opening the next. You might want to consider having a MessageBox popup if the Staff Password fails, offering the user the choice of returning to the "MainForm" or trying to enter his/her password again. If you go this route, depending on the sensitivity of your data, you might want to include a counter that kicks the user out of the database completely if three attempts at entering a staff password fails.

Hope this helps.

The Missinglinq

"Where have all the experts gone,
Long time passing;

Where have all the experts gone, long time ago.

Where have all the experts gone, gone to Think Tanks everyone.

When will they ever learn ?

When will they ever learn ?"
 
Behind the on click event of the command button on the switchboard put:

docmd.close
docmd.openform "Password"

Then create another form called "password" containing a label that reads "Please Provide Password", an unbound text box called "Password" and a command button with the caption "Submit"

Change the input mask of the text box. Select the one for password

Behind the on click event of the command button put:

if password = "what you want for the password" then
docmd.close
docmd.openform "YourFormName"

else
docmd.close
docmd.openform "YourSwitchboardName"

end if




Hope this helps.
 

Users who are viewing this thread

Back
Top Bottom