Modules & VBA :: Assign Password To Buttons In Forms
Feb 26, 2015
I have a form called departments . one that form i have 5 buttons. I want this form only to open when some logs onto the database . The buttons represent each department ...
1. sales
2 purchasing
etc etc
Is it possible to assign a password to those buttons so each department has security to their own form ...
View Replies
ADVERTISEMENT
Jan 23, 2014
I have built an access application that contains a set of buttons along the top of every form that serve as navigation.* These buttons each perform the same function on every form they are on. (menu opens the main menu, etc) I have database macros to assign each button the same function but I still have to go through each form and manually assign them. I was wondering if it was possible to define a public function that on db open will look for all buttons with a certain name and assign them the macro. (so all buttons called cmdmainmenu will have the OpenMainMenu macro assigned and so on).Before you go there, I have already tried the navigation form and set all forms as subforms.
View 5 Replies
View Related
Apr 12, 2006
Hi, I have a button on form A that opens form B, but i wud like to put a password on this button, so when you click it, you have to type in a password before form B opens.
I'm using access 2000.
Cheers
Alex
View 1 Replies
View Related
Oct 24, 2014
i have found a code that brings up a box when tab or clicking in to a box for editing as below:-
Dim strPassword As String
If InputBox("Please enter the password:") <> strPassword Then
SomeOtherControl.SetFocus
TextBox1.Locked = True
End If
its just that need to add a password as well, i have tried to put this in between the <> but this does not work. i would like a message to say incorrect password as well if possable.
View 4 Replies
View Related
May 30, 2005
Hello everybody,
I’m new here and I have a question for you..
Is it possible to place round buttons or oval buttons on your forms instead of the normal square ones?
Greets,
Tom
View 2 Replies
View Related
Nov 15, 2013
I am trying to use Access 2007 popup calendar to populate a combo box with a selected date. When I select the date on the calendar the above error appears.
Code:
Private Sub Calendar9_Click()
'Set Date to the selected date and hide the clalendar.
MAssBDate.Value = Calendar9.Value
MAssBDate.SetFocus
Calendar9.Visible = False
End Sub
[code]....
View 2 Replies
View Related
Jan 28, 2014
I want to create a table via SQL. This table should contain records that begin after a specified date.
Something is wrong with this syntax.
Code:
Sub TEST()
Dim t As Date
t = 1 / 3 / 2014
DoCmd.RunSQL "SELECT TRP.Customer, TRP.Material, TRP.Product_Class, TRP.TRP as Price, TRP.Valid_from, " & _
" TRP.Valid_to INTO [New_Prices] " & _
" FROM TRP " & _
" WHERE (((TRP.Customer)= 1223) AND ((TRP.Valid_from)>#t#))"
End Sub
View 14 Replies
View Related
Mar 27, 2014
Not sure whats going on here, nothing on the table that stops this from working. I just get Run-time error "2448 You can't assign a value to this object" When the code runs.
Code:
Private Sub Form_Open(Cancel As Integer)
Dim rst As DAO.Recordset
MySQL = " Select max(ID) from TblUserQry"
Set rst = CurrentDb.OpenRecordset(MySQL)
Myid = rst.Fields(0) + Int(Rnd(1) * 10)
Me.txtMyID.Value = Myid
End Sub
View 6 Replies
View Related
Apr 29, 2014
How to implement the procedure of clicking on the flag and hide the field in VBA? I know that want to assign - ColumnWidth=0.
Сomplete procedure fails.
View 10 Replies
View Related
Sep 13, 2014
I want to retrieve and assign values of a control's properties by naming the properties. So for example:
Dim myHeight As Long
Dim myPropertName As String
myPropertyName="Height"
myHeight = 315
Forms!Myform.MyTextBox.Height = myHeight
I can retrieve the value using Eval:
Debug.Print Eval("Forms!MyForm.MyTextBox." & myPropertyName ) gives 315
How can I do the inverse operation, ie.assign the value of a property whose name I have in a string MyPropertyName? I mean other than a brute-force approach with a huge Case.
View 3 Replies
View Related
Jun 24, 2015
I have a table (tblPrinterSelection) with three fields: Autonumber, DocType, PrinterSel
There are three types of values for "DocType"; "Document", "LargeLabel", "SmallLabel"
I want to assign a "PrinterSel" to each type of "Doctype", which basically means that the user selects the type of document and then the printer in a form that has the code below and then I need the code to automatically update the table.
Code:
Dim PrintSel As String
Dim DocType As String
'Assign a value to the printer selected variable
PrintSel = Me.lblPrinterSelected.Caption
If IsNull(Me.frmDocType) Then
MsgBox "No document type selected."
[code]....
What i am looking for is code that would pick the value for "DocType" and "PrintSel" assigned here and add them to the table so that I can use that info later.
I am only looking to have three rows in that table so if the "DocType" does not exist then a new row is created but if it does, only the value of "PrintSel" is updated.
I should end up with something like this:
1 Document Epson
2 LargeLabel HP
3 SmallLabel Canon
How can I do this?
View 3 Replies
View Related
May 27, 2014
Visual Studio IDE environment and I have been working with Access VBA for almost a year now.
I am very used to generating my form controls in runtime and being able to create some cool user interface interactions by being able to say btnExample.OnClick += MyDynamicClickFunction
MyDynamicClickFunction(Object sender, EventArgs e).... code
Any way to assign functions to the events of already made controls on a form. Probably during the load event?
Now I have found that there are many ways to replicate Visual Studio's features by accessing User32 and replicating them
View 2 Replies
View Related
May 29, 2015
I have a query that formats data into a list of personnel who are coming due for refresher training. The query is formatted to provide me all the details that I need to create an outlook task, and assign it to the person. I tried creating a button on my form to create a record set of that query, and then create / assign a task to each person based on the values from the recordset.
Code:
Private Sub SendTasks_Button_Click()
'Create the recordset and set it to the appropriate query
Dim rst As DAO.Database
Dim rstData As DAO.Recordset
Set rst = CurrentDb
Set rstData = rst.OpenRecordset("SendTasks_qry")
[Code] .....
Basically, the compiler stops at "Dim myOlApp As New Outlook.Application" with the error: "Compile error: User-defined type not defined"
View 14 Replies
View Related
Nov 7, 2013
I want to define a public variable and i am using the following code but it gives me Compile error Invalid outside procedure.
Code:
option explicit
public ABC1 AS VARIABLE
ABC1="FALSE"
View 7 Replies
View Related
Oct 6, 2014
I am using VBA to execute a 'Make Table' (named 'DT'). One of the fields in DT (named 'Dollars') contains numbers that have 6 to 8 digits; some are positive and some are negative.
These large numbers with no commas (or parentheses when they're negative) are incredibly hard to read.
Any VBA coding that will change both the "Format" and the "Decimal Place" Field Properties on the table I make (i.e. "DT"). I want to the Format property to read (#,##0.00;(#,##0.00)) and the Decimal Place property to read "2"). This will allow me to display a number like -10326786.41 as (10,326,786.41) which is incredibly more readable.
Is it possible to do this programmatically; I've search the internet high and low and could find anything remotely useful.
View 8 Replies
View Related
Aug 16, 2013
Using Access 2010: I have a query with four fields: ORG_NAME, PERS_NAME_LAST, CountOfORG_NAME, and BdMbrCount. There are a couple hundred companies in the database with 1-7 people associated with each company. I need to number each person so that they have a number, 1-7 in the MemberCount field of my query.
I have my query connected to VBA code.
I have experimented with code that I have found on the forum, just to see if I could get something to work and I am getting “Undefined function ‘BdMbrCount’ in expression. I am trying to pass [ORG_NAME],[PERS_NAME_LAST] to my function and assign the value of BdMbrCount to a new field in my query, BdMbrCount.
Code:
Function BdMbrNumber()
Dim qdf As DAO.QueryDef
Set qdf = CurrentDb.QueryDefs("YourBdMbrsRRecognizedQry")
'Set rst = CurrentDb.OpenRecordset("SELECT [ORG_Name],[PERS_NAME_LAST],[CountofORG_NAME], [BdMbrCount] FROM YourBdMbrsRRecognizedQry")
Dim ORG_NAME As String
[code]....
View 14 Replies
View Related
May 6, 2013
I have an unbound form, with a subform datasheet (sfmStaffDS) - not linked to the parent form, which displays a list of all staff. There is another subform (sfmStaff), which displays data based on a field in the form which takes its value from the DA subform.To add a staff member I press the button and this clears the fields down as expected.
However, when I start entering data (in the First NAme field), I get the error as stated in the title. Interestingly, I can carry on and the data gets saved as 'normal'.I have used this technique before with success, except that the DS subform is linked to a value on the parent form.
View 9 Replies
View Related
Sep 3, 2014
I am trying to return a single value from a table and assign it to a string to be used later but Dlookup isnt working at all. below is the code im using and the error message im recieving is "wrong number of arguements or invalid property assignment"
Code:
Sub boo()
Dim result As Integer
result = dlookup("Definition", "Config", "Parameter = 'Mail Folder'")
End Sub
View 13 Replies
View Related
Nov 1, 2014
I am new to access. In a form, I have a combo box(combo1) that store values in field(remarks1) in a table.The values in combo box are:
SL
ST
DI
SL + ST
SL + DI
These all values are being saved in remarks1 quiet easily. I have more fields in the table:
SL1
ST1
DT1
SLST1
SLDI1
I want when I selet SL from combo1 it saves SL in remarks1 and save "1" as well in SL1 field.I want to have same result with all five combo1 values
View 2 Replies
View Related
Mar 6, 2014
I am total green in access specially in VBA world and trying to learn during my free time..I am able to learn to learn how to assign values to LISTBOX, based on already created Query (using Wizard).Now I am trying to learn, HOW to create the query through VBA and assign to listbox instead of first creating query..What exactly I am trying to learn is upon opening of the my listbox show already existed records (for information)
Following the information
tlb name = Currency
tlbfield1=Currencycode
tlbfield2=Currencyname
[code]....
View 5 Replies
View Related
Dec 2, 2014
I'm building a simple database for storing records about books.
I'm currently working on one of the data entry forms. Part of this form is supposed to enable the user to add details about the book and the series that it belongs to (if it does belong to one).
The relationship is One-to-Many: One series can have many books. I've made the series part a sub form.
When I enter some data to test that it works, I get an error message when I try to add a new series using the sub form. It says:
"You can't assign a value to this object.
*The object may be a control on a read-only form.
*The object may be on a form that is open in Design view.
*The value may be too large for this field."
As far as I know there isn't anything wrong, so I'm not certain why this error message comes up. I think it may have something to do with the primary key being the AutoNumber data type, but I just click 'OK' and ignore it, and it works fine.
The database works as far as I can see, I just want the error message to stop appearing.
View 6 Replies
View Related
May 23, 2013
I'm new to access and I'm struggling with the transfer of a form we use for fieldwork. I want a technician to be able to come in from the field and enter data in a way that is visually similar to how the collected it. To do this, I have created a form that is structured like this:
View 1 View 2 View3 View4
Sediment % XX XX XX XX
In the table 'results' , I would like to collate the information in what I call 'flat format', which is structured like so:
Site Date Parameter Value
XX XX SedimentView1 XX
XX XX SedimentView2 XX
...
The thing is, I can only figure out how to assign a text box to a single field, i.e. value. What I need is for the field 'Parameter' to autofill based on the value-textbox name, e.g SedimentView1. Is there some simple way to do this?
View 1 Replies
View Related
Apr 24, 2014
Auto number will not work for what I want to do. I am creating a simple database that will assign the user with the next incremental number in a field. The intent of the database is for the user to enter three text fields and then obtain the number. I believe that Dmax would work but do not know how to make populate the table.
View 10 Replies
View Related
Jan 21, 2014
I am using a basic Order form and Order Details subform to capture my information. Customer is selected, then Products and Quantities are filled in... the subform calculates the total price. This all works great. Then I have a problem.
I have some national customers that require shipping to multi regions. I would need to select the regions and it has to calculate a new case cost for each product for each area. Could be up to 100 (10 products x 10 areas) new calculated prices.
Then for other customers, I will use just the case cost for the whole order (multiple products) and add one shipping fee to cover the drop. 3 products and only 1 fee added to the total.
Currently, my Order Form uses a Tab page and the Order Details are on the first tab. I could put the Shipping Info on the second tab, I just don't know how to add up to 10 different shipping regions to generate 10 new prices or the one drop fee to the total price.
View 1 Replies
View Related
May 30, 2013
I am working with textbox [DispCD] (a date field) on form [Contract]. There is a dropdown on combobox [Searchbox] for selecting the desired record. I am writing VBA in the [Searchbox] OnChange event. The control source for [DispCD] would normally be "=Searchbox.column(11)". If "column(11)" has a date, I want [DispCD] to show that date and then be locked. If "column(11)" does NOT have a date, I want [DispCD] to allow entry of a date with the date picker showing. I've tried to assign the control source to [DispCD] with this:
CSVal = Format(Forms![Contract]!SearchBox.Column(11), "ddd m/d/yyyy") (this works)
If CSVal = "" Then _
Forms![Contract]!DispCD.countrolsource = "=SearchBox.Column(11)"
I get "Object doesn't support this property or method" error.
View 4 Replies
View Related
Mar 28, 2013
Having problems writing to this textbox on my form?
Textbox name is: Last_Name
Text Control Source is :Last_Name
Line of code is :
Code:
Me.Last_Name = Me.Combo0.Column(4)
I get the following data in the textbox " #Name?"
And the error:
" You cannot assign a value to this object"
View 7 Replies
View Related