I want to be able to open a form and unhide some fields on that form that have been set to hidden, basically if the file paths are wrong it ponts them back to my form where they fill them in , normally these are hidden
Code:
'checks to see if the file paths in the admin screen are ok before allowing to go foward to avoid errors from dowloading data
'get the file path to import data
Dim ImportLoc As String
ImportLoc = DMax("[Path]", "TblsysTransImport")
'Gets the file path to export data
Dim ExportLoc As String
ExportLoc = DMax("[Path]", "TblsysTransExport")
' checks to see if the file path is valid to stop people going further if incorrect or first time use If Dir(ImportLoc, vbDirectory) = "" Or Dir(ExportLoc, vbDirectory) = "" Then MsgBox "sorry but your Import / Export locations dont exsist " & vbNewLine & "These are required so you can download your scan data. " & vbNewLine & "You will now be redirected to enter valid paths"
'open form where they update the paths
DoCmd.OpenForm "Frmadmin", acNormal
'normally hidden
Frmadmin!Line111.Visible = True
and Access doesn't like this.I'm getting a 3075 error "Syntax error (missing operator) in query expression 'and [Mail] = Yes'.What is the correct syntax for this?
I would like to make clickable labels on my form, so if the user has any questions about the field, clicking on the label would bring up a message box that would give them more information. I know how to write onclick events one by one for every label, but there are a lot of them, and I feel like there has to be a better way.
I put the label names, and the text I'd like for the message box in a table, and I'd like to have a module that will allow me to click on a label, and have the right text come up.
I've researched ways to do this and have come up with nothing. The farthest I've gotten is an array tied to the form open event that just displays all the message boxes from first to last, one after the other. I believe that's on the right track, but is not a workable solution as is. I need to be able to tie the message box to the actual label the user clicks.
In what I believe is called the Navigation Bar - the bar at the left of the Access screen, one can see the various tables, queries, forms and modules associated with a project. As an experiment, I right-clicked on a form, and clicked the option "Hide in this Group". Now it doesn't show up in the group. But I can't figure how to get it back. I assumed there was some sort of unhide command like in Excel. If there is such a command in Access I can't find it. How do I make it so I can once again select this form so I can open it in design mode. (I assume that the form still exists in the project, because I didn't delete it).
I downloaded a time clock template the other day and Ive been tweaking it for a while now. There is one thing I can't figure out:
There is a form called frmClockOut, which is a subform on frmClockIn.
This subform appears after the ClockIn button is clicked. The problem is, if I close the database for any reason, and leave someone clocked in, the ClockOut button does not appear until after you re-click ClockIn.
The developer has put in a safety so that it does not "double-punch" someone in or out so its ok there. Id just rather keep this subform open or always showing and cannot figure out where its done on here.
I have tab control form with (5) tabs. For this discussion - Tabs 1 through 5. For a blank (new) form sheet tabs 4 & 5 need to be hidden. Based on what is selected via the drop down box (on tab 1) then tabs 4 & 5 may remain hidden or needed to be un-hidden. Example: [DropDown1]
I think one I figure this out then I can use the 'OnCurrent' event to check the drop down selection as a user selects the a record or scrolls through records.
I have a form (Form1) and a in it, I have 2 subforms datasheet (Subform1 and Subform2). I have ID, First Name, Last Name in each as headers.
I need to:
1) Find the subforms 2) Loop through the subforms and get all the labels 3) Change the captions
The reason for this is because I need to have the forms bilingual. I do have a function that will translate the caption (called TranslateThisWord). I just cant figure out a way to loop through the subforms and find all the labels.
I want a user to enter a number into an input box and then based on the number in this box a form will be opened with records associated only with that employee number. (All employee numbers are stored as text)The code below opens the form, but it is blank.
Private Sub cmdOpenAddKeys_Click() Dim EmployeeNumber As String EmployeeNumber = InputBox("Please Enter Employee Number:") DoCmd.OpenForm "frmAddKeys", acNormal, , "[Forms]![frmAddKeys]![empno]=" & EmployeeNumber End Sub
I have a list box that displays records. When i double click a record it opens the form needed.However I want it to open the form but default to a specific tab. But when it goes to the tab, the subform within it needs to match the ContractID of the record they double clicked on in the search form?I currently have this which opens the Client Form based on the ClientID of the listbox query search results and the client id of the main record.
Code: Private Sub SearchResults_DblClick(Cancel As Integer) If CurrentProject.AllForms("frm_Clients").IsLoaded Then DoCmd.Close acForm, "frm_Clients" End If DoCmd.OpenForm "frm_Clients", acNormal, , "[ClientID] = " & Me.SearchResults.Column(0)
So in theory If doubleClick then open Client Form on Tab3 where subform Contract field ContractID is matches the ContractID in on the search results?
I have a form that is opened as hidden when my startup form loads. Data gets entered into it from other forms so whenever I switch records the hidden form needs to be opened to the matching record.
To accomplish this, I have been using the DoCmd.OpenForm in the OnCurrent event with the WHERE clause matching the PK/FK. I have had no luck with the SearchFor method.
It seems silly to have to keep reopening a form to go to a specific record when the form is always open already. Plus, I am wondering if it is affecting the forms' load times.
I have searched for bits of code to copy other people better than I, and had some success but I am failing to complete, so it is now time for me to visit you all. I am trying to open a PDF from a button on a subform. The location of the PDF is specified in a field. I want to open the PDF and search for a Member ID criteria also listed in a field on the Form.This is my code:
Code:
Private Sub Text12_Click() Dim strPath As String Dim Searchmem As String strPath = [Notetxt] Searchmem = [MemID]
[code]....
Adobe Reader reports "There was an error opening this document. The file cannot be found." but then opens the file (that's something).So it's the "search" bit that is the problem, and I cannot for the life of me get my search parameter to be used.
I tried Link model "bank_pay" with the main_form << to add details of information >> by "pay_num" in main_form and "num" in "bank_pay" by filter >>
Code: Private Sub pay_type_AfterUpdate() Select Case pay_type Case Is = "1" DoCmd.OpenForm "bank_pay", acNormal, "", """[forms]![main_many_1]![main_many_sub]![pay_num]="" & [num]", , acNormal
I am trying to load a form based on an if statement. I think my issue is that I have the DB set to Display form "frmSplash" on open. I have tried the following (frmSplash form load event) but it continues past the frmMenu and stops at the frmSplash. I want to open the DB and look to see if it is registered and if yes then open frmMenu. There is 1 record in tblRegistration so it should open to frmMenu. I checked and it is seeing the 1 record.
Code: Private Sub Form_Load() Dim rs As Recordset Set rs = CurrentDb.OpenRecordset("SELECT * FROM [tblRegistration]") If rs.RecordCount > 0 Then
[code]...
Does the display form on open override all? how to achieve to goal?
I'm trying to lock a checkbox when the forms open and depending if one has role as admin, it should unlock it.When I add the below code in the on open form I get error:
I am having trouble opening a datasheet form with mulitple where clauses here the VB that I have so far
Private Sub Command192_Click() If IsNull(Me.Startdate) = True Or IsNull(Me.Enddate) = True Or Startdate = "" Or Enddate = "" Then MsgBox "Start AND End dates are required" ' Exit Sub '
I need to use DMax to open the form on the last record based on the serial number. This code is what I have to open the form currently, but I want only the latest record related to the serial number:
I have a form (frmSearch), based on (I think) John Big Bootys code. On it, a search box, which filters results as you type. Works great.
Instead of presenting the search results in a listbox, I wanted it in a subform (sfmSearchresults). Also works great.
Problem was this: I wanted a button on this form, to open another form based on [CustID]. For a listbox, I could use columns(0), but not for a subform. After much trying I got this to work:
Code: Private Sub cmdVisaPren_Click() Dim strWhere As String strWhere = "[CustID] = " & Me.sfmSearchResults.Form.Controls.Item(5) DoCmd.OpenForm "frmAddCust", acNormal, , strWhere, acFormEdit, acWindowNormal End Sub
The part that I don't understand is the Item(5). The subform is based on a query (qrySearch), from tblCustomers. tblCustomers fields is as follows:
Item(0) in strWhere would return Adress1 as [CustID]. Item (1) = Newspaper1, Item(2) = Newspaper2, Item(3) = FirstName, Item(4)=LastName, and (finally) Item(5)=CustID.
I don't get the logic. With listboxes, I could just count columns for columns().
Have attached my database. It's just a test database, with 4 people. The final database will have about 1200 people, and many more fields. Its .accdb (Access 2013). I tried converting to Access 2002-2003, but couldn't get it to work.
I am using Access 2003. I would like to be able to open a versatile form that can open any selected table in data sheet form. Currently I am using Command Button with the names of the tables as the trigger. Looking for VBA that would change the form's Record Source to a selected table and add all the fields of that table to the form on open. I figured that I can use the OpenArgs to get the form Record Source to be assigned, but how do I assign all the fields of the table to be dropped into the form?
we have gotten in to a routine of copying, pasting and bastardizing old databases instead of creating new ones from scratch - and we've had a problem recently where we've started off with one master database back in 2011, which has then been the base for practically every single major DB we've created ever since.So this month we've copied and pasted (again) and started adding new features to what's already there, and the thing has corrupted. I've copied and pasted the same version three times and added all the new bits, and the same thing has happened every time.
So this time I've copied and pasted and tried my best to clean up, get rid of the dead weight and (where necessary) create completely new objects, split into FE and BE versions etc, and I've reduced the overall weight of the DB by about 50%.Due to time constraints I now need to crack on and get this thing working again and, for the most part, it does - but now I'm having trouble carrying the filter over from the OnClick Event of a form button to the next form it's opening.
We're using the DB to record attendees at an Event we're running later in the year. This is the code that I'm running from the OnClick Event of the button on Form1:
Code: Private Sub btnBkg_Click() On Error GoTo Err_btnBkg_Click Dim stDocName, vFilt As String Dim vBkgRef As Long Dim vContactID As Long
[code]....
You can see I've tried to use vFilt instead of the actual code for frmBooking's Where Condition, but for some reason it does not carry over to the form whichever way I try - when I open the immediate window and type ?vFilt it returns a blank entry. Not sure how to show the 'Where Condition' in the Immediate Window?Before Update, Open and Activate of frmBooking, but I'm hoping that the problem lies with what I've posted up here, as I don't want to get into posting the frmBooking code...
It may be worth noting that the button resides in the Header of a continuous form, with conditional formatting that changes the button caption depending on whether there is a value in the BkgRef text box of the record that has the focus.
Who can tell me how to minimize Access window while it's form is on top of other open windows (e.g. other applications which are maximized like Excel). By using acCmdAppMinimize command, only the Access window is minimized and if other applications are maxmized, they will be on top. So is there any vba solution to do what I explained?
I have a from that has information icons that opens a separate form to support users make the right choice on a form. With each information form users are able to choose "Yes" or "No" and then it returns them back to the form they started. I am having trouble setting the focus to the control the user original left the form from.
Form A Control 1 Control 2 Control 3
Form B Information for Control 1
Form C Information for Control 2
Form D Information for Control 3
For Forms B - C I would like the form to close, open Form A and then set focus to the control that the form was providing information for.For example, if you are on Form C and you make a decision, I want Form C to close, Form A to open and focus to be set to Control 2.
Code: Private Sub image5_Click() Dim sWHERE As String Criminal_Background.Value = "Yes"
I have a button on my main db, that opens a second db using hte following code:
---------------------- 'Dealing with external objects, use inline error trapping On Error Resume Next Dim appAccess As Object
Dim db As Database Dim strAppPathName As String Dim strAppName As String Dim strTimesheetPathName As String
[Code] ....
This code works great to open the other db, and handles wheter the other db is already open or not, but I cant seem to pass the variable to the other db using the startup switch /cmd.
I suspect if I used the shell method it would pass the cmd , but I havnt found any way to test if the db is already open with the shell method.
How can I pass a variable to the other db when opening it using VBA?