Modules & VBA :: Checkbox Controlling Navigation Tab

Oct 10, 2014

I am trying to figure out how to control a navigation tab with a checkbox. I have a database for my fire dept and the check box is called "deceased". When a member passes away, the active box gets unchecked and deceased gets checked. Under the member subform, there is a tab, navigationbutton19, that is called deceased also and under this tab all their burial information is stored. What I am trying to do is, if the checkbox is not checked, I want the tab to be enabled = false.

View Replies


ADVERTISEMENT

Forms :: Combo Box Selection Controlling Checkbox Availability

Oct 6, 2014

I have a project database where I keep track of the work in progress on monthly bookkeeping for our clients. I have a form where I use a ComboBox to select the client and another ComboBox to select whether a sales tax report must be filed Monthly, Quarterly or Annually. I have 17 CheckBoxes one for every month, quarter and year-end. I want the selection in the sales tax reporting ComboBox to trigger which CheckBoxes are available to check.

That is, if "Monthly" is selected in the ComboBox, then only the 12 monthly CheckBoxes are available to check (the 4 quarterly and 1 year-end CheckBoxes will be disabled). If "Quarterly" is selected in the ComboBox then only the 4 quarterly CheckBoxes are available to check. Of course, "Annual" is the third option. The disabling of CheckBoxes must be on a record by record basis. "Monthly" could be selected for one client (one record) and "Quarterly" for another client (another record).

View 14 Replies View Related

Modules & VBA :: Controlling Font Within A String

Jul 20, 2015

I have spent the better half of the afternoon researching how to accomplish controlling a bold font in a string I am building and sending to Excel.

Code:
' set text for safety hazards and controls
Concretetxt = "Concrete Demolition & vbCrLf & Hazards - dust, flying debris and skin Irritation. & vbCrLf & Control - Respirator, goggles, gloves, inspect equipment prior to use."
Excavationtxt = "Excavations & vbCrLf & Hazards - Damage to underground wires, collapse, falling materials/equipment. & vbCrLf & Control - Ensure utilities have been marked and hand dig when in close proximity, shore properly, Keep clear when lowering materials."

This is a sample of how the strings will build. I will select a task like Concrete Demolition and string it together with other tasks I would like "Concrete Demolition" in bold with the blurb following it then the next task would follow with a bold heading.

My thought is now that it may be easier to control by putting this data into a table instead of building the strings.

View 2 Replies View Related

Modules & VBA :: Controlling Scroll Bar Position

Jul 5, 2013

So I've got a form:
- A set of unbound controls filters (using a dynamically-built WHERE statement) a subform in datatable view.
- A set of bound controls displays the currently selected subform record; the two reflect one another.
- A set of unbound checkboxes at the bottom allows the user to change which fields are displayed in the subform.

Turns out, all of this makes for a pretty big form. Some of the users have screens that will not fit the full form due to resolution settings, physical size, aspect ratio, etc. Whatever the reason, the result is one or both scrollbars appearing on the form.

The issue is this: Whenever the filter controls are changed, the form's Current event runs (because the After Update events for the filter controls all change the main form and subform's Recordsource). But the Current event causes the form to requery (or refresh?), meaning the focus returns to the control with Tab Index 1 (a "Home" button near the top of the form).

Thus, the form tends to "jump around" a lot when users are determining the records they want displayed.Is there a way to avoid this?

- Can I prevent the "Home" button from getting the focus during those times?
- Alternatively, can I set the position of the scroll bars so the user doesn't see that jumping around every time a control is updated? I found some interesting ideas that worked for continuous forms, but mine is a single form, so bookmarking methods won't solve my issue.

View 7 Replies View Related

Modules & VBA :: Controlling Fields In A SubForm Displayed In DataSheet Mode

Dec 2, 2013

I have a Form to Display Projects that has a SubForm displaying Sub-Projects related to them. The main Project Form has a Combo Box which allows a user to select a ProjectID to display. The SubForm has a ProjectID Field as well. When the Project ID is selected in the Main Form, only the appropriate Sub-Projects are displayed in the Sub-Form.

On the SubForm, there is a Field named ActionID, which uses the following VB Code to limit the availability of the Fields in the SubForm that apply to Dates. If the selected Action is Install, only Install related Dates should be available. Likewise, if the selected Action is Remove only Remove related Dates should be available.

Code:

If Me.ActionID.Column(1) = "Install" Then
Me.AssetInstallMonth.Enabled = True
Me.AssetInstallYear.Enabled = True
Me.AssetRemovalYear.Enabled = False
Me.AssetInstallMonth.Locked = False

[Code] ....

Everything seems to work as expected until there is more than one Sub-Project is the SubForm and they do not contain the same Action. In these cases, it appears as if the Sub-Projects in the SubForm are not being treated as individual records. If Sub-Project is Added or Modified to have an action of "Install", all records are treated as Install Records (only Install related Dates are available), regardless of their content.

Is there a way to update the properties for only the row that has been selected?

View 5 Replies View Related

Modules & VBA :: Navigation Bar Search Box

Oct 4, 2013

Using vba code I want to populate the search box found in the navigation bar. I don't want to filter the form as it's important the user can scroll up and down to see other records in the continuous form. At the moment the user has to manually enter search to find the record.

View 5 Replies View Related

Modules & VBA :: Removing Navigation Bar From Forms

Feb 7, 2014

I was just wondering if this could be done by code or he only way o do it was by the form properties?

View 1 Replies View Related

Modules & VBA :: Navigation Button Do Not Continue

Sep 3, 2013

I have made a contact form where particular member credentials are coming in text boxes, i have kept a combo box also on the top to view by the phone number, if the phone number is entered the credential of the member comes, and also the navigation buttons that is first, previous, next and last.

The main problem if i select phone number by combo box on the top, the navigation button do not continue from that part, even if i press next or previous it shows no records found.

View 13 Replies View Related

Forms :: Not Able To Disable Navigation Button When Login Navigation Form

Nov 15, 2014

I am not able to disable NavigationButton when i login navigation form using login form. I am using MS access 2007 - 2010.i am using below code but getting error.

Forms![Navigation Form]!NavigationButton13.enable = False

Error
Run-time error '438'
Object doesn't support this property or method.

Any other method to disable NavigationButton.

View 2 Replies View Related

Modules & VBA :: Filter Not Working In Navigation Form

Jul 20, 2014

I inherited this quote and trying to enhance it but having problem.

The filter in navigation form is not working but it is on its own form, the filter is working without problem.

View 5 Replies View Related

Modules & VBA :: Show / Hide Navigation Pane?

Jul 15, 2015

I use DoCmd.ShowToolbar "Ribbon" acToolbarNo (or acToolbarYes) depending on a value in a table which I have shown certain "trusted" users how to change.

But is it possible to do something similar with the Navigation Pane?

View 4 Replies View Related

Modules & VBA :: Custom Record Navigation Buttons

Jul 11, 2014

To briefly explain my database; it is a bespoke referral management system within a hospital. Each record on the database contains patient demographic information, as well as information on their referral (i.e. date of referral, date of assessment, date of commencing treatment, discharge date etc.) Therefore, the same patient will appear multiple times in the database, with each separate record corresponding to a unique referral pathway.

The database forms are split to show patient information at the top, with referral information shown in a subform. I am trying to add navigation buttons to the subform that will allow the user to scroll through the referrals corresponding to the patient currently displayed on the main form.

Each patient has a uniquely identifiable number associated with them, and so it seems straightforward enough in my mind to have a button that will search for the record in the database where the patient's number matches the patient number of the current record, and where the referral date is minimum (for "First Referral"), maximum but less than current (for "Previous Referral"), minimum but greater than current (for "Next Referral"), and maximum (for "Last Referral").

View 5 Replies View Related

Modules & VBA :: Navigation Pane Opening / Closing

Dec 4, 2013

I have a user login form wherein my users authenticate their employeeid as well as their person PIN. If the user authenticates with a valid username/ password combination, then the employee id and the role (permissions) for that user are stored on the form and it is minimized to stay open. If the user that authenticates has "Admin" role then I want to unhide the navigation pane. For all other roles I want the navigation pane to remain hidden.

That said, the default setting in the database is for the navigation pane to remain hidden. I have a piece of code on the login form as follows:

Code:
If Me.role = "Admin" Then
DoCmd.SelectObject acTable, "NavigationPaneObject", True
DoCmd.RunCommand acCmdWindowUnhide
Else
Exit Sub
End If

This is successfully unhiding the navigation pane, but I'm getting the following error message and I don't know how to get it to go away."Run-time error '2544':

"Microsoft Access cannot find the NavigationPaneObject you referenced in the Object Name argument."The code is unhiding the navigation pane.

View 1 Replies View Related

Modules & VBA :: Navigation Control Subform Saving

Jul 18, 2013

Access 2010. one of the forms i load into a navigation form is in datasheet view and some vba re-sizes all the columns as it loads in.

However, this then means that when i try to navigate away to another form i always get prompted whether to save the form or not.

because the form is in a navigation subform i can't use:

Code:
DoCmd.Save acForm, Form_NavigationForm.NavigationSubform.Form.Name
' or this...
DoCmd.Save acForm, "my_form"

in both cases i get an error : the object my_form isn't open

View 1 Replies View Related

Modules & VBA :: How To Validate That At Least One Checkbox Is Selected

Apr 13, 2014

I am trying to validate that the user selects at least one checkbox out of three on the form in Access 2010. They can select one, two or even all three if they wish, but at least one must be checked. I am using the following code attached to the click event of a command button. It was fine but seems to have stopped working. The control names are generic to illustrate my code. The form is unbound:

if (chk1 + chk2 + chk3) = 0 then
Msgbox "Please select at least one checkbox"
exit sub
end if

View 14 Replies View Related

Modules & VBA :: Navigation Form - Filter On Subform Not Working

May 12, 2015

I have a navigation form which has two subforms on it (ie 2 tabs linking to different forms). I have got aq filter working for one of the forms but not on the other. This is using

If IsNull(Me.txtoperationscontract) Then
MsgBox "Please type a contract number into the textbox!", vbInformation + vbOKOnly, "Incorrect Details"
Else
Me.OperationsSubform.Form.Filter = "[Contract]='" & Me.txtoperationscontract.Value & "' "
Me.OperationsSubform.Form.FilterOn = True
End If

The problem is that it does not work on subform B because the Contract field does not exist.

View 6 Replies View Related

Modules & VBA :: Disable Navigation Pane - Not Just Minimize / Hide It

Mar 5, 2015

I would like to disable the Navigation Pane completely, based on the security level of the user that logs in, of course.

I have code that checks their level (I'm an "Admin" and everyone else is a "User"). If they are a user, then it hides the ribbon and minimizes the nav pane. If the login is mine, it enables everything.

That works, but the only problem is that the user can just maximize the Nav Pane on their own and access all the tables, and I don't want that. I can't find any code that completely disables the pane.

I have this code connected to my login button on my login form:

Code:

If Security = "User" Then
DoCmd.ShowToolbar "Ribbon", acToolbarNo
DoCmd.NavigateTo "acNavigationCategoryObjectType"
DoCmd.Minimize
Else
DoCmd.ShowToolbar "Ribbon", acToolbarYes
DoCmd.NavigateTo "acNavigationCategoryObjectType"
DoCmd.Maximize
End If

I can go to the options menu and disable the nav pane completely, so I know since only I have access to the ribbon, I could always go in each time and recheck the display nav pane option on that menu. But, that could be a little bit of a pain having to do that each time.

Also, I know I could finish the design and convert the DB to an MDE, but since my DB isn't broken up into a front/back end, I have to access that same DB everyone else uses, and if any changes need to be made, I don't want to have to use my backup, transfer over the changes any user made to the records, and then reconvert it back to an MDE each time.

If it's possible, I'd like to do all this using VBA. If they aren't an ADMIN user, then disable everything for them, but if I login, enable everything for me.

View 14 Replies View Related

Modules & VBA :: Hide Navigation Pane And Documents Tabs

May 27, 2014

I'm wondering if it is possible to create a module to hide the navigation pane and document tabs? I know this is possible via the Access Current Database options however I'd prefer this to be done via an Auto Exec that runs the sub. (i already have it for the ribbon)...

View 5 Replies View Related

Modules & VBA :: Hide Navigation Pane On Single Form Only?

Jan 9, 2015

I have a data base that when first opened a login form I created pops up. I am trying to set it up so that when it opens you do not see the navigation pane. once logged in though I do want to have access to that again. I have found other VBA code online but nothing that lets me remove the navigation pane from that first form alone. I have it set so that the Ribbon is not shown when the form opens but does show once a user is logged in.

for the ribbon I used:

DoCmd.ShowToolbar "Ribbon", acToolbarNo

I thought I remembered a while ago reading a code like that for the navigation but not saving it because I did not think it would be needed (I am very new to Access) But now I cannot find it.

View 4 Replies View Related

Modules & VBA :: Database For Data Entry - Update And Navigation

Oct 28, 2013

I have made a database for data entry, currently i have a challenge of getting it update and navigate.

On the form if the staff name is xyz it should only shows the records filled by xyz in form and navigate that records only. I am attaching the data base also....

View 3 Replies View Related

Modules & VBA :: Click Button (auto) - How To Refresh Navigation Bar

Jul 1, 2015

Code:

ExportWindow = FindWindow(vbNullString, "Output To")
OkButtonTest = FindWindowEx(ExportWindow, ByVal 0&, "DUIViewWndClassName", vbNullString)
ButtonOKTest = FindWindowEx(ExportWindow, ByVal 0&, "Button", "OK")
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0

The above code works and my issue is how can I move the mouse to the OK button and click on it to. The reason why is when I SETTEXT to the address bar it does not refresh so I SETTEXT to the file name box to navigate to the prescribe address which will refresh the navigation bar once the OK button is clicked. How to refreshing the navigation bar.

View 2 Replies View Related

Modules & VBA :: Selecting Combo Value Changes Checkbox On Other Form

Nov 10, 2014

I have form 1 that brings up a record, I then open up form 2 with that record details.

On the 2nd form I have a 'status' combo box with values 'OK', 'bad', 'unsubscribe'.

I want to change the value of a checkbox, 'Active', on the 1st form, 'Maildelivery', from true to false if the combo value is changed to 'bad'

Here's the code:

Private Sub cmb_status_AfterUpdate()
If Me.Status <> "OK" Then maildelivery.Active = 0
End Sub

View 3 Replies View Related

Modules & VBA :: Current Checkbox Label Update

May 25, 2014

I have the following module which displays the backcolor of a checkbox label if it is true or false

Private Sub FormatLabel(chk As Control)
With chk.Controls(0)
If chk Then
.BackColor = vbYellow
.BackStyle = 1
.ForeColor = vbRed

[Code] .....

Which works great! But I cannot figure out how to make it work in the control AfterUpdate Event. I tried using it in the current control's (checkbox) after update event

Dim itm As Control
If itm.ControlType = 106 Then FormatLabel itm

but nothing happens (no change, no error message).

I have tried creating a new module:

Public Sub CheckBoxFormat(chk As Control)
If chk = -1 Then
chk.BackColor = vbYellow
chk.BackStyle = 1
chk.ForeColor = vbRed
Else
chk.BackColor = vbWhite
chk.ForeColor = vbBlack
End If
End Sub

But when I try to call it in the AfterUpdate event for the particular checkbox

Private Sub CheckBoxA_AfterUpdate()
Dim itm As Control
If itm.ControlType = 106 Then
CheckBoxFormat itm
End Sub

I get the error message "Expected Variable or Procedure not module"

So, (1) is my module all wrong or (2) am I calling it incorrectly or (3) wrong on both items?

View 13 Replies View Related

Modules & VBA :: Creating Queries Based On Value In Checkbox

Jun 30, 2013

I have some code that creates queries based on a value in a checkbox.

So, depending on that value, the queries may or may not exist.

I need to take those queries (if the exist) and create one union query.

This code creates the first query beautifully, but it won't union the second query.

Code:
Private Sub cmdSubmit_Click()
Dim blnQueryExists As Boolean
Dim cat As New ADOX.Catalog
Dim cmd As New ADODB.Command
Dim qry As ADOX.View
blnQueryExists = False

[Code] ....

View 4 Replies View Related

Modules & VBA :: How To Stop Display Navigation Pane In Access 2010

Nov 11, 2013

i am running some code from vba to add a linked table and the do some lookups, then delete the linked tables.

When the linked table gets added, the navigation pane gets displayed. I have set it to do not display in the settings and it does not when it opens but when this code runs it opens and then stays open until the db is closed and reopened.

I am trying to use my db as a software and I really do not want this to show.

I have also noticed this in a database I have which has update queries and was fine in access 2000 but does what i described above when using in access 2010.

View 2 Replies View Related

General :: Modules Not Appearing As Object Types In Navigation Pane

Apr 19, 2013

I am now working on this new database. I would like to make a calculation so that I could derive a value called eGFR from a patient's serum creatinine. This is a test of kidney function.I am having the following problems.

a. Modules are not appearing in the Navigation Pane of the Access 2007. When I press 'Object Types' in the Navigation Pane I get all object types such as tables, queries, forms, reports, macros but not modules. I know there are modules as I have written lots of vba code.

b. I have written the following code within this Function. The following is the code.

Public Function eGFR(creatinine, Gender, Age) As Single
If IsNull(Age) Or IsNull(creatinine) Then
eGFR = 0
Else

[code]....

This code is working fine in another database, however when I try to upload a query in the current database that has this function in one of the fields, I get an error saying the the function eGFR does not exit.

I have inserted the function into one of the modules that I have managed to enter.

Do I need to deposit the code elsewhere? How do I access Modules from the Navigation Pane?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved