Password on a Form


I would like to create a password on a form, but I cannot get the form
to close when the wrong password is entered. I have also tried
docmd.close.
Appreciate some help.

Private Sub Form_Current()
Dim Password, Pword
Password = "Swordfish"
Pword = InputBox("Type in your password")
If Pword Password Then
MsgBox "Sorry, incorrect password"
exit
End If

End Sub
Posted On: Monday 22nd of October 2012 05:58:10 AM Total Views:  236
View Complete with Replies

RELATED TOPICS OF Microsoft Access PROGRAMMING LANGUAGE




Using a password to protect forms

Hi I have created a database with a form that is protected by a password, but in order for the password to be set the user needs to convert the string into keycode. For example, during testing the password used is PASSWORD with the code 2818. It would obviously be better for the user to be able to change this password without having to know the code. To make the password I orginally followed another tutorial so am a little out of my comfort zone. THanks pb
VIEWS ON THIS POST

161

Posted on:

Wednesday 17th October 2012
View Replies!

Ho to Save password while connecting Database from MS access & how to shedule queries

Hi , Can someone pls help me.. I have a mdb file with some 110 queries in it and a made a ODBC connection to connect to my database and daily at 10:00 pm i ave to run all these queries and sent to higher level. So my problems are... 1) Each time when i click on query it will ask password and every time i ahve to enter a password and hit enter once output comes i have save the output into excel and we have privillage(mean a button) in excel to "Analyze with excel " so all this process takes 2 hrs for me and i know iam wasting my time... 2) Second problem as iam runing this reports daily basis exactly i have to start running this reports at 10:00 PM. So is there any way to shedule this reports so that they can run at 10 daily and save these reports in certain location in excel format. If you have any suggestions pls let me know.. if you want any detail information pls let me know....
VIEWS ON THIS POST

154

Posted on:

Wednesday 17th October 2012
View Replies!

How to create accounts with username and password in MS Access

I tried creating new accounts in MS Access 2003 thru Tools>Security>User and Group Accounts. I can log in successfully in the database with my username and password in MY COMPUTER. But if I send it thru an email to a person in other countries. The data doesnt ask for a username and a password anymore. They can access the database without username and password.
VIEWS ON THIS POST

160

Posted on:

Thursday 18th October 2012
View Replies!

ACCDB password

hello, is it possible to programmatically set or change the password to an accdb file from within an application (my app is written in VB 6) i know this was possible in the old mdb format but what are the options for the new format i must use the accdb format for security reasons.
VIEWS ON THIS POST

91

Posted on:

Thursday 18th October 2012
View Replies!

Refreshing linked tables on a password protected back end?

I'm using Access 2000. My database is split between the front end and the back end. When the front end is loaded the file location of the back end is checked. If the back end doesn't exist, a form is loaded which allows the user to enter a new file location. This all works fine, however as the back end has a password on it, when the link tries to refresh, for each table I get an invalid password error message. How can I get past this error Can I specifiy the password in my code If so, how do I pass this into the back end db before the tables are refreshed Here is my code: Code: Dim dbs As Database Dim tdf As TableDef ' Loop through all tables in the database. Set dbs = CurrentDb For Each tdf In dbs.TableDefs ' If the table has a connect string, it's a linked table. If Len(tdf.Connect) > 0 Then tdf.Connect = ";DATABASE=" & FilePath & "\" & FileName & ".mdb" Err = 0 On Error Resume Next tdf.RefreshLink ' Relink the table. If Err 0 Then MsgBox Err.Description End If End If Next tdf As always,
VIEWS ON THIS POST

131

Posted on:

Monday 22nd October 2012
View Replies!

conditional formatting on continuous forms

I have an accounting database with queues that list each requisition's important information (ID, vendor, dates, etc) plus the its status (not yet submitted, approved, ordered, delivered, filed, etc). I'd like the font of the status field to change color depending on its value. I can't use the standard conditional formatting because there are more than 3 statuses. I've tried an If/Then statement, but the form only looks at the status of the first record, then colors the font of the status fields for the consecutive records that same color no matter what their value. How do I get it to evaluate per record As in, if the first record has a Submitted status, its font is blue, but the next record is Ordered so its font is red. Here's my code, I used it in the OnOpen event for the form: If req_process_status_rec_id = 2 Then process_status.ForeColor = 13209 ElseIf req_process_status_rec_id = 1 Then process_status.ForeColor = 8388608 ElseIf req_process_status_rec_id = 3 Then process_status.ForeColor = 8388736 ElseIf req_process_status_rec_id = 4 Then process_status.ForeColor = 16737843 ElseIf req_process_status_rec_id = 5 Then process_status.ForeColor = 52479 ElseIf req_process_status_rec_id = 7 Then process_status.ForeColor = 6723891 ElseIf req_process_status_rec_id = 8 Then process_status.ForeColor = 16711935 End If
VIEWS ON THIS POST

96

Posted on:

Monday 22nd October 2012
View Replies!

search form with option buttons

, I have a form named Welcome which I want to use as search menu for my database. I have added 4 option buttons and a unique textbox into which users will write their query criteria. My database has 4 queries and each option button should refer to one of them once selected Obviously I will need a command button that will run the query.
VIEWS ON THIS POST

92

Posted on:

Monday 22nd October 2012
View Replies!

Apply Filter from subform to Form by DATE

these lines: Code: DoCmd.OpenForm strForm, acNormal, , strWhere ' for date DoCmd.OpenForm strForm, acNormal, , strWhere2 ' for date stDocName = "frmRate" DoCmd.OpenForm stDocName, acNormal open the same form, three times in succession, with three different filters/where clauses. This won't work thee way you want it to. The final form will be filtered for the customer but will have no date filtering at all. What you need to do is expand you code to create one BIG filter or where clause that incorporates the order date and the arrival date and the customer name for this to work properly. , I am sorry but the sweating doesnt work. And I really need to finish this thing today!Pleas help Anyone
VIEWS ON THIS POST

80

Posted on:

Monday 22nd October 2012
View Replies!

Duplicate a form and sort a form in ascending or descending order?

, Is their a a way I can have a button or something in which duplicates all the data in the text boxes instead of re-entering data Also how can I sort data (DATES) that is in a form in descending order. Thank you, Onofrio
VIEWS ON THIS POST

73

Posted on:

Monday 22nd October 2012
View Replies!

Users unable to access new forms/tables

I enabled security on an .mdb which included several users that are in the Full Data Users group. After I did this I needed to add a new form to the application, so I logged into the application and added it. However, though the admin group and the Full Permissions group can access it fine, the Full Data Users group cannot. I have double checked all of the settings and have even rebuilt the .mdw file to no avail. Any thoughts
VIEWS ON THIS POST

112

Posted on:

Monday 22nd October 2012
View Replies!

How to delete current record in bounded form?

Hi . I made bounded maintenance form customer table in my access db. But when I try to delete a record by clicking on the delete button I get the following error. I be happy if some one help me delete record successfully.
VIEWS ON THIS POST

80

Posted on:

Monday 22nd October 2012
View Replies!

SAVE Dlookup value on form to TABLE

I have created a frmOrder form that uses autofill fields using dlookup when a company name is selected from the cboCompany combobox. However! I noticed that the value that has beed retrieved from dlookup function are not stored in the table (tblOrder). How can I achieve this I have written the code in the control source of the field (in this case: LastName field) in the form like this: =DLookUp("[LNamePIC]","tblCompany","CompanyID=" & [cboCompany]) The DLookup works fine, just I want the value to be stored in the table. Please help me ! I have been browsing the internet for the whole day and i can't seem to find the right solution!
VIEWS ON THIS POST

84

Posted on:

Monday 22nd October 2012
View Replies!

Filling form and emailing it

I have a form that the user will fill, then email it to a customer. I dont want to send the whole table, just the values that the user just inserted in the form. Any idea on how should i do that using Access I am aware of the SendObject method, but i never used it, and dont know how.
VIEWS ON THIS POST

76

Posted on:

Monday 22nd October 2012
View Replies!

How to create a search form in msAccess?

I am using msAccess to develop a small application. I have 2 tables, student and course, and I need to create a form with 3 fields - by_id, by_date, by_course_id This form can generate a view only table according to the field the user entered. Can anyone help me on this What's the step to do so Thnx
VIEWS ON THIS POST

104

Posted on:

Monday 22nd October 2012
View Replies!

update a form by selecting from a combo box

I have an unbound combo (because it is synchronised with another unbound combo box) box that selects a record, but I can not get it to update the rest of the form to show the required data. The form looks up project data from 3 seperate tables which are all linked by relationship. What do I need to do to make this work Thx for looking.
VIEWS ON THIS POST

81

Posted on:

Monday 22nd October 2012
View Replies!

Reusing info on a form

I have a from which is based on a simple query. It prompt users to enter a booking number and then shows all info they have previously entered themselves. I did this in order to give them te opportunity to alter the info they've entered earlier. Now what I would like to have as an option is to give them the same form, for which they enter a bookingno. and having the possibility to reuse the information attached to the booking. My question is: How do I create something like this Cause if they change the bookingno on the current form, it will not create a new record with a different bookingno but it changes the bookingno in the current record. So what I want is to change the bookingno to create a new record with mostly the same info. Can you help me out Thx, Lion85heart
VIEWS ON THIS POST

83

Posted on:

Monday 22nd October 2012
View Replies!

Open only forms// I need Help

hi i am new in Access and i make one project with it. Now i need when i open the indexForm i want open only it and not the access with table,queries,reports and access menu.
VIEWS ON THIS POST

88

Posted on:

Monday 22nd October 2012
View Replies!

Single page form and mouse scroll wheel problem.

Is there a way to prevent a user from switching records on a single page form when he rolls his/her mouse wheel. I have noticed that users accidentally scroll the wheel, and this switches them to the next record. I need for them to remain at the current record they have chosen, or at the new record they are working on.
VIEWS ON THIS POST

189

Posted on:

Monday 22nd October 2012
View Replies!

Linking fields in a form!

Ok. I have used access before to hold data but have always accessed and used it via asp. I have never actually tried to use the access forms and queries! But for a current project i am having to use it. So far its been fairly simple but im stuck on one point. I have one table that holds user info and has a foreign key from another table. On my form i want the user to be able to lookup the foreign keyes available. Only i want the lookup to show the description field in the other table not the unique id (primary key) but when they slect the relevant row its obviously need to record the primary key of the other table in the foreign key field in my user info table. How can this be done Im not sure if i explained this very well. If anyones unsure what i mean please ask my to clarify.
VIEWS ON THIS POST

418

Posted on:

Monday 22nd October 2012
View Replies!

Text box format

all - I have a text box in a report that I want to combine a label and a date field (date field is based on a table). I need to format the date field to be different than the way it is in the table though. I used the "Format" part of the property window to say (mmmm", "yyyy) but it only works if the date field is the only thing in the text box. Example: In the text Box, I want ="Medical Record Review - & [Date Added]" where [Date Added] now says e.g., 9/11/04, and I want it to say September, 2004. Putting (mmmm", "yyyy) in the format part of the property window works only if [Date Added] is the only thing in the text box. Is there a way to include both the text and the called field in the text box AND format the [Date Added] field as I need
VIEWS ON THIS POST

258

Posted on:

Monday 22nd October 2012
View Replies!