In the initial Form_Open code there is a string that fails before the form is open, preventing me from opening the form and accessing the VBA code to correct the problem.How can I access the VBA code to correct the problem if it otherwise prevents me from opening the form so I can access the VBA code?
On a form I have a listbox that allows me to navigate around my records. The listbox is filtered and I get the redords that I waqnt from the table.My problem is that when I open the form the record that is showing is one from the table but not one that is in my listbox. I want it to show the first record in the listbox...This is the command I have on open:
Code: DoCmd.GoToRecord , "", acFirst
which is where the fault lies, but I dont know what I should put in its place. The list is List273 and the form is frm_Profile
I have a form and this form shows some values from one table. One of the fields named as Key. I want to open another form and show the record that has the same value as Key.
I am able to make this with filter but the form opens and when the user navigates the record, it creates a duplicate value in related table.
I want to open form and find specific data to display and then stop at this record.
I have a main form [Job Quote Form 10-2205] and I am trying to add a command button to open up [Job Process Form-MKD] and have the [Job Process Form-MKD] open up and only show the records that match a certain field, in this case what I call "JobTrackNo" in the [Job Process Form-MKD]. (see attached .jpg)
This problem started to happen only recently, namely you will see that the left column under [Job Quote Form 10-2205] is blank, where normally there had been a number of fields to choose from. The fields are all still available, they are just not opening when I try to match two fields.
So I have a form which is showing the current record and you can scroll through these and make modifications to them from the form as opposed to using a table.
The form has the following fields populated from the main table
Customer name (Can appear more than once) Status Date Servers Positions
In addition it has several buttons for next record, previous record, first & last record, new record, delete record and update record.On this form i have a text box that i want to be able to use to search for a record using the customer name when you press the search button associated with it. I've got some code and it is mostly working but it seems to be moving the text entry cursor to the date box of the record for some reason.
What I want it to do is take the text from the search box and find it and move the form to that record.
Code: Private Sub btn_cstmr_srch_DblClick(Cancel As Integer) On Error GoTo HandleError Dim strFindWhat As String strFindWhat = Me.txt_cust_search.Value
My database has two main tables: Table1 and History
Users can add data to this table and decide if store part of data into the History table using an append query behind a cmdbutton. I do this to create an Historical Log of my records.
I then have a main form (form1) with the following code on the OnCurrent event:
If Not IsNull(DLookup("[SSN]", "history", "[SSN] = '" & [SSN] & "'")) Then msgbox "Record present in the Historical Log!", vbOKOnly, "Warning" end if
I would now like to change this code so that users are prompt with a message that allows them to either open the form1 or the Historical log (frmHistory)
I would need something like this but cannot get it to work:
If Not IsNull(DLookup("[SSN]", "history", "[SSN] = '" & [SSN] & "'")) Then msgbox "Record present in the Historical Log!", vbYesNo, "Warning" If vbYes Then DoCmd.OpenForm "frmHistory", acNormal, "qryhistoryfrommsgbox", "", , acNormal
If vbNo Then ' 'open the regular form1.
Another thing I cannot figure is why this pop up msg comes up even if I close the form. Is there a way to revome it from the close form event?
I have a database with lists clients across the UK. I have now been asked to provide options where users can select clients grouped by geopraphical area e.g say clients in Scotland.
I can of course do this but having numerous identical forms where the source queries have different parameters depending on the regions required.
The only problem with this is that I would need numerous forms and queries. Additionally, there are options on the form to navigate to linked forms which would all need to be unique.
What I would like to have options on my main (Switchboard Type) Introduction Form to select the region. The code on the relevent command button would include the parameter. I would therefore not require the additional forms.
The open form codes includes:
Dim stDocName As String Dim stLinkCriteria As String
I feel i need something after "frmClients" such as qryClients.ClientArea = "Not Scotland". Various attempts to incorporate something has created errors.
I have the following code that I have been trying to get to work:
Private Sub txtSocNumber_DblClick(Cancel As Integer) On Error GoTo Err_txtSocNumber_DblClick
Dim stDocName As String Dim stLinkCriteria As String
stDocName = "FrmApplicantFullDetails"
If IsNull(Me.txtSocNumber) Or Me.txtSocNumber = "" Then MsgBox "This record is empty", vbInformation, "No Data" Me.txtSocNumber.SetFocus Else stLinkCriteria = "[ApplicantID]=" & Me![InvestigatorID] DoCmd.OpenForm stDocName, , , stLinkCriteria End If
Exit_txtSocNumber_DblClick: Exit Sub
Err_txtSocNumber_DblClick: MsgBox Err.Description Resume Exit_txtSocNumber_DblClick End Sub
I have the following two tables:
Applicant and Investigator
Applicant: ApplicantID InvestigatorID etc
Investigator: InvestigatorID etc
The relationship is setup as 1 investigator to many applicants.
What I am trying do is this. I have form with a subform in it. In the subform there is applicant info IE SS# LName, FName and that is it. What I want to do is be able to double click on the SS# have the form "FrmApplicantFullDetails" open so you can view the work up on the applicant or edit info on the applicant.
Am I going about this the right way with the above code? Or is there something else I am missing in the code or is there code out that will do what I am looking for that is easier?
I have a text box on my form which I use to attach hyperlinks to pdf's, this works great but after inserting a hyperlink nothing is displayed in the text box to show it has been linked unlike using attachment, the only way I know if that a hyperlink is placed is to right click and go to hyperlink and then open, is there a way to show the link on the text box and just double click on it to open the pdf. I am trying this as the size of the database will far exceed the 2gb that access allows if I just use attachments , even if I split the database (over 10000 pdfs )
Hi I need code to open TeacherDetailFrm form Main form.
I have TeacherStudentSubFr*m on the Mainform, FirstNameTxt on the TeacherStudentSubFr*m, and TeacherDetailFrm. I need code to open the TeacherDetailFrm By double click on the FirstNameTxt.
I use this code but no data come and query dialog box come.
Private Sub FirstNameTxt_DblCli*ck(Cancel As Integer) Dim DocSubForm As String Dim DocText As String DocSubForm = "TeacherDetailFrm" 'DocText = "[Result]=" & "'" & Me![result] & "'" DoCmd.OpenForm DocSubForm, , , "[ FirstNameFld ]=forms![TeacherStudentSubFrm]![ FirstNameTxt]"
End Sub
I like to upload the file but no way in this forum
I once used a program, when you click this .mdb file, it opens a main Form interface that user can run programs such as view report etc. That is, all tables, querys reports, other forms are behind the sence (user does not need to know them).
Could anyone tell me how to do this? Thank you for yoru help.
I am at my Login Screen, I want it to return to the Login Screen if you select "NO" and Close the DB if "YES"
Here is my current code:
Private Sub Form_Close() If MsgBox("Would you like to EXIT the Database?", vbYesNo, "Quiting Database") = vbYes Then Application.Quit Else ??? End If End Sub
I have a report that tracks scores for our employees. From the report, you can click a button to add a new score in a form or edit an existing score(frmscoretracker). On this form there are two subforms, in a tabbed control to track additional information about the score; what areas were marked down(Trends), and was it a failing score(AutoFail).
When this form opens I have it programmed to only show the subform if there is data in it. The goal being, if I am adding a new score and there is no existing trends or Autofails for this new record, neither subforms will show - I will add an after update even to show either trends or autofail depending on the score recorded. Also, if someone chooses to edit the score, whatever subform with data, will show as well.
When someone clicks to add a new score, opening this main form to a new record, both of the tabs show. However, if the form opens to an existing record, the appropriate tab shows. Here is the code
Code:
Private Sub Form_Open(Cancel As Integer) 'If the subform has a record, the tab is visible, if not, the tab is not visible If Me.frmtrends.Form.Recordset.RecordCount > 0 Or IsNull(Me.Trends) Then Me.Trends.Visible = True Me.TabCtl33.Visible = True Else Me.Trends.Visible = False End If
[code]...
Both tabs are set as not visible in the default settings. Is there something in this code that is triggering then to be visible when there is no record in the main form?
when i open a form i want to open another frm at the same time. i have a main form with some buttons in it. when i click on a button and a form opens then i am not able to click on a button to open other forms from the main form.
I have a bound form with a few fields. I would like to run a sub after some of these fields are modified, but not others. I would like it to run only once, after user finishes his work on the form.
When using the Unload event - the form on the form is not there anymore (or did I get something wrong?).
Is there a way to trap Data on form just before the form closes?
Basically I have a Customer Form, which I have a New party button on it,this button opens up the party form to a new party, what I would like it to do is open up a new party but make the new party for the customer I had selected in the previous form.I have tried the GoTo macro's but cannot seem to get it to work.
I am thinking on clicking the button it will need to get the Customer ID, and then open the party form, create new party, and paste in the Customer ID, which then updates the Name - Date - Address - Company Fields.
I am trying to add the name of the employee show up in on the opening form after logging into the database. I am able to get the user right (Admin only), but not the name. In the Default Value in Properties, I have it set to =CurrentUser() and I have the Employee field in the Control Source to record current user.
How can I make this so it indicate the user logged in?
Once I enter records in my form and move to a new record, they won't show up in the form. For some reason there are a few records showing in the form but not all. Unsure what has happened or what I need to do to get the records showing.
If I open a the form called frmhome, I can enter information search on hours completed and even enter new towns. The table that the information gets entered into is called Crisis_support_workers. If you open this table, you will see a lot of information that has been entered. However, if you open the form that is meant to put info into that table, there is only 7 records and most of them are blank records. The form where info is entered is called Crisis_support_workers v3.
With this code, I can open Word and Excel files, but not PDF. Please let me know what I'm doing wrong. (I tried changing strProg = "C:Acrobat.lnk" including to a .exe file but nothing happens when I click the Open button)
I'd like to do the following: when the user does something on Form A, Form B has to be open and the Forms should be located on the sides (Form A to the left side, Form B to the right side) of the display so the user can see them at a time.
However both Form A and Form B has an automatic centering function set when used alone.
Is there a way I could push this from code? I can't fine anything like that among the form's property.
I have a form in which job times for individuals is entered. As the data is entered, a macro fires to calculate various costs (Nat Ins/Pension/Total cost etc etc), and that data is stored in a table.
I now have written code to enable the inputting of the data into the database directly from the Excel sheet in which the data is first entered - this is great as it cuts out a data entry repeat and will be a big big time saver.