I'm trying to have a button in a form that, when clicked, will time stamp a text box already formatted for time. But once the text box is filled with a time, the button then disables itself for that record.
If I switch to another record where the text box is empty, the button will enable itself without closing the form, but obviously re-disable itself if I go to a record the text box is filled.
I'm sure I could use conditional formatting for it, but I don't think I'm going about it the right way. I already got a basic button built to timestamp.
I have 44 checkboxes, each has a textbox next to it. What I want is when the user selects a checkbox, the textbox next to it will be enabled. Also, when the user unselect a checkbox, the textbox next to it will be disabled and any value entered is cleared.
Another way is whenever the user enters a value in a textbox, the checkbox associate with it is selected and vice versa.
Is there a way in access, through vba or any other means, which would allow me to either enable or disable criteria in a query based on the value of textbox??
Like i have a query that displays bookings customer has made between two dates, so i made a query and in the starting and ending date fields i get the value from form. In case if the use does not enter ending date, i would like to run the query with starting date only that displays booking made after the starting date.
Currently the starting date criteria is set to a textbox of form, and so is ending date. So if customer selects 1st April 2015 as starting date and 30th April 2015 as ending date the query should display the bookings between 1st and 30th of April. And if the user enters only 1st April in starting date it should display bookings starting from 1st April onward.
Basically I want to put a code in the "on load" event of a form that enables or disables navigation buttons based on a value in a table (the table has 1 record and 1 column).
So if the value is "A", I want to hide navigation buttons on load; if it is "B", I want to show navigation buttons on load.
I know I can set this property in each form, but I have a number of forms that I want to configure at the same time.
My problem is that I don't know how to reference the value in the table.
im trying to enable/disable checkboxes based on a combobox selection for instance,
i make the selection in a combo box called terms and conditions. i want it then to only enable the business,domestic and summary check boxes for that type, with the onther check boxes staying disabled. is there a way this can be done through code like the statement "only enable if this letter type selection has been selected"
I have a form. and it has three buttons. Such as Submit, Reject, Under Observation.
I want : 1) If i click SUBMIT button it will be disable and other two buttons REJECT and UNDER OBSERVATION will be enable 2) If i click REJECT button it will be disable and other two buttons SUBMIT and UNDER OBSERVATION will be enable 3) If i click UNDER OBSERVATION button it will be disable and other two buttons SUBMIT and REJECT will be enable
Need some help here! I have a table where different types of records are recorded. Let say for argument's sake my tblMain looks like this:
RecID (autonumber) EntryType (Combo box linked to my tblEntryType) Field1 (text) Field2 (text)
I then have tblEntryType which lists the different types of entries to be made and which fields are required on my form and what the lables should be. The structure looks more or less like this:
On my form, my record source is tblMain. When my user makes a selection in the combobox EntryType, there is a lot of code behind the AfterUpdate function like this:
I find this setup a bit labour intensive, especially as my form has quite a few fields! Is there a way that I can "look up" which fields are required from the table and enable/disable and label based on my tblEntryTypes without me having to creating so much code/use the "column" function.
Let me know if I am not making myself clear and I will be glad to try explain so more!
Need some help here! I have a table where different types of records are recorded. Let say for argument's sake my tblMain looks like this:
RecID (autonumber) EntryType (Combo box linked to my tblEntryType) Field1 (text) Field2 (text)
I then have tblEntryType which lists the different types of entries to be made and which fields are required on my form and what the lables should be. The structure looks more or less like this:
On my form, my record source is tblMain. When my user makes a selection in the combobox EntryType, there is a lot of code behind the AfterUpdate function like this:
I find this setup a bit labour intensive, especially as my form has quite a few fields! Is there a way that I can "look up" which fields are required from the table and enable/disable and label based on my tblEntryTypes without me having to creating so much code/use the "column" function.
Let me know if I am not making myself clear and I will be glad to try explain so more!
I have a form that has a listbox and a subform. The listbox lists names of events, start date and end date. The subform bellow reveals names of participants to the event that is clicked in the listbox. Against each participant's name is a button to delete the participant.How can I hide or disable the delete button if the start date of the event is past?
I am asked to create a checklist for a number of tasks to be executed in a particular shift. However in some tasks can be skipped. There are three shifts per day.
To accomplish this i have created a continious form with a number of checkboxes per task which represent the days of the week. The tasks itself are stored in a seperate table with a checkbox per shift (task settings). If the tasks must be performed in a particular shift, the checkbox is activated (= true).
Goal here is, if a task doesn't have to be executed in a shift the task should not be visible on the continious form. The recordsource of the continuous form is a query, which contains a join between the table with the task settings and the table with the tasks performed.
I have placed some code to perform the task in the form's current event
In the continuous form current event I have placed for every checkbox the following code:
Private Sub Form_Current() If Me. PerformTaskShift.Value = True Then Me.MaandagOchtend.Enabled = False End If End Sub
However when i execute the code and load the form, not only the checkbox in the row mentioned are set invisible, all the rows are. Is there any way to set only the checkboxes on the rows mentioned invisible, in stead of all rows?
I have some code like this that sets some fields up to be disabled when the form loads, then enables them when a combo box ('Type') is selected to 'Instrument'. This works fine as far as it goes, but if the user has selected 'Instrument' and then goes to a new record, the fields remain enabled.
Private Sub Form_Load() Me.CalibrationTolerance.Enabled = False Me.AcceptanceLimit.Enabled = False End Sub
[Code] ....
I've looked this up and it appears I need to use the property Form.NewRecord, but nothing I do seems to make it work.
In ContactIDForm it contain 1 textbox name 'TextBox' with Button Name 'Btn'
In ContactIDForm there is only 1 Text Box ContactIDTextBox and 1 Button. User Enters ID in TextBox and On Button Click Event it should check data from TextBox in Table name (ContactDetailTable) in field ContactID and if there is record matching, ContactInfoForm should Open else NewContactForm should open with ContactIDTextBox value in it.
I have all of my text fields disabled and I want the user to press a button to make them enabled. I have a field that links to the database called, "lastName".Under the button's clicked property, I have coded,
Private Sub Command44_Click() lastName.Enabled = true End Sub
Here is my problem: When a certain yes/no box is true (checked) other fields on the form are not enabled. That works just find when I am on the record that I click the yes/no field. When I go to another record and then go back to the previous record the fields that should be disabled due to a certain yes/no box being true are now enabled and not disabled. Below is my code. Can anyone tell me what I am doing wrong?
On searching the forum, I found the following post for enabling/disabling BypassKey. I did as instructed but on clicking the label, it gives 'syntax error with 'On Error Goto' in red color and highlighted.
Hello af1112 welcome to the Forum...
I use this code that ghudson supplied at the beginning of this post.
First of all create a copy of your db (Just incase.. )
Now......
Create a label on a form somewhere and make it invisible to other users (I have mine hidden in my main Switchboard)
The idea is that by clicking on the label you can activate/de activate the code without anyone else knowing about what you are doing..
Name the label "bDisableBypassKey" & hide it somewhere in the corner of your screen or something.
Copy & Paste the code inbetween the bold text to the onclick event of the label you have just created
Private Sub bDisableBypassKey_Click()
On Error GoTo Err_bDisableBypassKey_Click 'This ensures the user is the programmer needing to disable the Bypass Key Dim strInput As String Dim strMsg As String Beep strMsg = "Do you want to enable the Bypass Key?" & vbCrLf & vbLf & "Please key the programmer's password to enable the Bypass Key." strInput = InputBox(Prompt:=strMsg, Title:="Disable Bypass Key Password") If strInput = "MY PASSWORD" Then 'Change password to your own ChangeProperty "AllowBypassKey", DB_BOOLEAN, True
Beep MsgBox "The Bypass Key has been enabled." & vbCrLf & vbLf & "The Shift key will allow the users to bypass the startup options the next time the database is opened.", vbInformation, "Set Startup Properties" Else Beep ChangeProperty "AllowBypassKey", DB_BOOLEAN, False
MsgBox "Incorrect ''AllowBypassKey'' Password!" & vbCrLf & vbLf & "The Bypass Key was disabled." & vbCrLf & vbLf & "The Shift key will NOT allow the users to bypass the startup options the next time the database is opened.", vbCritical, "Invalid Password" Exit Sub End If Exit_bDisableBypassKey_Click: Exit Sub Err_bDisableBypassKey_Click: MsgBox "bDisableBypassKey_Click", Err.Number, Err.Description Resume Exit_bDisableBypassKey_Click
End Sub
Now paste this code in the Double click event of the same label
Private Sub bDisableBypassKey_DblClick(Cancel As Integer) Private Sub Disable_Click() Option Compare Database
Option Explicit
Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
Dim dbs As Object, prp As Variant Const conPropNotFoundError = 3270
Set dbs = CurrentDb On Error GoTo Change_Err dbs.Properties(strPropName) = varPropValue ChangeProperty = True
Change_Bye: Exit Function
Change_Err: If Err = conPropNotFoundError Then ' Property not found. Set prp = dbs.CreateProperty(strPropName, _ varPropType, varPropValue) dbs.Properties.Append prp Resume Next Else ' Unknown error. ChangeProperty = False Resume Change_Bye End If
End Function
To Test click on your label to activate the password prompt and type in the wrong password (that will now disable the bypass key) and you will not be able to open the db by holding down the Shift button
to disable enter the correct password and you will be able to use the Shift button
Hi there I am new to Access and I am currently modifying an existing DB. Currently this DB has a main table which holds a bunch of Patient info such as:
Name Age AssignedStaff Condition etc....
The assigned staff field is populated from another table (Staff), which holds all the staff members working at the institution. However a couple of these individuals have left and they no longer want their name to show up on the form when inserting a new record. However we do want there name to still be in the DB for historical reporting purposes......My intital thought was to create another field in the Staff table that would hold either a "Active" or "Inactive" entry. Then just have a simple If statement to see if the staff member is active or inactive. Does anyone see any problems with this solution or propose a more efficient method.
I am creating a data entry form with combo boxes related to two different tables: TblEducationID EducationID - Auto# PK Education - Text TblMediaFill MediaFillID - auto# PK Incubation Time- text Incubation Temp - text
In my form, I have a combo box that the user selects the Education Type (Media Fill Test; Aseptic Technique Observation, Watch Video, etc....)
I want the incubation time and temp text boxes to be disabled unless Media Fill Test (ID#4) is selected on the first combo box. (I get a Procedure Declaration does not match error.)
Private Sub EducationID_AfterUpdate() If EducationID = 4 Then IncubationTime.Enabled = True IncubationTemp.Enabled = True Else IncubationTime.Enabled = False IncubationTemp.Enabled = False End If
Private Sub A300_Completed_AfterUpdate() If A300_Completed = True Then A300_Date.Enabled = False User1.Enabled = False Else A300_Date.Enabled = True User1.Enabled = True End If End Sub
for some reason when creating a new record the above disabled/enabled fields retain the same property of the last records check? The form in a single (not a continuous)