Opening A Report Instead Opens A Form (which Opens A Report)?
Jun 15, 2005
Hi,
I've been given an existing database to modify, and I'm struggling somewhat to see how the author has implemented certain functions.
On a main menu form (autoexecs on starting the database), there are various "Search By" option buttons to generate a report, ordered in various ways. The "On Click" field for each of them refers to a macro, called Buttons, and a line in that macro dependant on the type of search (e.g. OnClick = Buttons.byPerson).
The Buttons macro runs an OpenReport command, the report corresponding to the search type (e.g. Buttons.byPerson has an OpenReport command for the "Report by Person" report).
However, when I click the search buttons (or indeed run the corresponding reports) I instead get another form which allows the search criteria to be specified - this then generates the report (I would assume based on the relevant query - e.g. Person Query), but I cannot understand how this works.
Google searches have not helped much as I can't seem to find an adequate search phrase to use, and I've been staring at the thing for some hours now. Any help getting me off in the right direction would be much appreciated!
Since converting to Access 2010, when I use the "PDF or XPS" button to create a PDF from a report, after the save dialog it opens the PDF in Adobe reader, and then after I close it there is another dialog with the option to save the export steps. Is there any way to just be able to save the PDF and go back to where I was without having to do the extra clicks to get back?
Back in Access 2000 I had created a custom button on a toolbar that would automatically make a PDF from the open report, but that didn't transfer over when I converted the database to 2010.
Dim stDocName As String Dim stCriteria As String stDocName = "Rallies this year" stCriteria = "[Year of Rally] = " & Year(Date) MsgBox (stCriteria) DoCmd.OpenReport stDocName, acViewPreview, "", "", stCriteria
the output in the msgbox is [Year of Rally] = 2013 which seems fine but the OpenReport command then gives me a type mismatch error the [Year of Rally] is a calculated field in the query - the record source.
I have tried
stCriteria = "[queryname].[Year of Rally] = " & Year(Date)
I am sure this has come up a thousand times and I searched but could find nothing about this. I have a database with one main form and many queries. When the database is opened by users I would like for only the form to show. I do have queries in a dropdown list on the form to run. Basically, I only want the form to show when the database is open but I want to be able to get to the menu's etc when I need to.
I have a form based on a query. The query sorts records by ID number. When I open the form, it opens to a record that is not the lowest ID number. It's the same record each time that it opens to, but it's not the correct record There is no filter or sort order on the form, and it seems like starting with record 2 it is sorting correctly. any ideas? thanks.
This is the first time I've used this forum so, hello everyone
My first question is about filtering a form
When a user is in the menu screen and selects a command button to view details, the next form that loads shows every record within the main table. So the user can use the navigarion buttons to go through each record.
There's search criteria on this form so the user can select which ever record they like.
Because of speed issues, I'd rather the form filtered a record (whichever one) as soon as they pressed the command button.
I've thought about how i'd do this and can't really come up with much; looked at openargs but my VBA isn't that hot yet
I have a form that I built with the intention of creating new records. I want to convert it to use with existing records too. I can't seem to get it to look at anything but new records. I imagine it is a property setting and something very minor to a seasoned Access programmer.
I have a form with a combobox. From this combobox I would like to trigger the opened of a different form with the name and surname of the patients selected into the combobox.
I used this vba code
Private Sub Find_Click() Dim stDocName As String Dim stLinkCriteria As String stDocName = "ID Patient" stLinkCriteria = "[PTS]=" & Me.Identification
[Code] ....
The problem is that when the form Id patient is already opened every thing works fine but when the Id patient form is not opened it looks like if the combobox was not able to trigger the form with the name and surname of the patients!
I have a User Main Menu as seen below with the command buttons for New Work Log Entry and Edit Work Log Entry. The New Work Log entry opens a blank Work Log as shown below. The Work Log form's record source is tblWorkLog. The user will fill out all the fields except the End Page and Total Worked Pages. The user will then exit out of the database. When ready to enter the total worked pages the user log back in to the db and will click on the Edit Work Log Entry.
This is supposed to open up the last entry the current user was working on so that he or she can enter the End Page and Total Worked Pages
Currently it is opening up the last entry of the table even if it was a different user's.
How can I change this? I need it where it opens up the last record for that person. There are going to be 50 users so I can't have it open up to the last record of the table.
Help! What seems like a simple problem is driving me crazy. I have a form (one of 2 that are nearly identical) that appears to be opened “filtered”.
When the form opens, none of the controls react to clicks, it does not allow edits. It has a feel as if a master lock is on the form. Finally, a right click to a shortcut menu saw some progress. If I select “Filter By Form” (the current record fields become blank) and then select “Apply Filter/Sort”, the form becomes “normal”, i.e. all fields and controls behave normally.
I have gone over the code of this form and its near-twin and cannot see any differences relating to this problem.
Assuming there is some type of stealth filter at play, Access Help yielded: Use this procedure to delete any type of filter, regardless of what method you used to create it. 1. Click in the form, subform, datasheet, or subdatasheet whose filter you want to delete. 2. Switch to the Advanced Filter/Sort window (Advanced Filter/Sort window: A window in which you can create a filter from scratch. You enter criteria expressions in the filter design grid to restrict the records in the open form or datasheet to a subset of records that meet the criteria.). 3. On the Edit menu, click Clear Grid. 4. Click Apply Filter on the toolbar. I can not find the “Advanced Filter/Sort” window they talk about. I am assuming that this is a filter issue.
Does anyone have any insight on why this form opens “locked” and what the related filter issue may be?
I have also tried the VBA code: Me.Filter = "" Me.FilterOn = False To no avail.
I'm trying to add data about a form to a table when the On_Current event fires. The data I want to add is: windows login username
date and time the On_Current event occurred name of the form that was opened that the form was opened the number of the record (ID) in the table the form is based on
I have the following code
Private Sub Form_Current() If Me.NewRecord Then Call FlimOpen("OR IR No", "OPENED") Else Call FlimOpen("OR IR No", "OPENED")
[Code] ....
Excuse the use of 'FlimOpen' but I needed a unique word that I would remember (inspired by FlimFlam the cat on the children's channel CBeebies here in the UK)
I try to compile and I get an error about the wrong number of arguments or invalid property assignment. However, the event does fire correctly when I open the form or move from one record to another so something's working!
A form that used to automatically open when the db was launched has been deleted. However, the instruction to load the form is still in the db. I would like to remove that instruction, but I can't seem to find where to look for that code. In Access 2007, I went on DB to the Database tool menu, but its not in the switchboard manager.
Hi, When the user clicks on the file name, I want the form to load automatically & also at the same time minimize the database window (i.e. the window where all the tables, queries etc are listed). Any suggestions?
I need to hide my subform on load or open of the main form but am experiencing some weird results. I have tried putting Me.SubForm.Form.Visible = False in both the on open and the on load of the main form and it works only if the tables on which the subform have records in them. If the tables for the subforms are empty I get an error 2467 telling me that "The expression you entered refers to an object that is closed or doesn't exist." I find this strange because from all I can find the subform loads first.
How can I hide the subform when the main form opens no matter what records exist or don't?
I open a form (EntryBasic) for users to enter data in, which is then saved to the only table in the database (MasterTable). The form (EntryBasic) has a list box with four choices: red, white, blue, orange. The button that opens the form is placed on another form (MainForm) The form (EntryBasic) record source is MasterTable.
A user is on the MainForm and needs to add a new record related to red. When user clicks on the button (NewRedEntry), I need the form to open and the list box pre-selected to red.
Is there a macro or VBA code that might simply execute this action, preferably something that can be attached to the NewRedEntry button?Even better, if there are two list boxes, code such code be applied to same NewRedEntry button, where both list box values are pre-selcted with the click of this button?
I am having a hard time with this project that I'm working on at the moment.
I have created a modal dialogue form that has a macro set to open another form and close the current form at the same time. The form that is being opened has textbox controls that have the default value set to hold the data that is in the textbox controls in the modal dialogue form that is closing. The problem is, is that when the modal closes, the controls in the next form display #Name? and the data is not copied to the next form.
I have a table which holds information relating to a fleet of vehicles; each of these vehicles is currently physically checked on a daily basis for a number of items, one of which being to check that the vehicle has valid VED (tax disc).
With the paper disc being abolished now, we have a situation where the individual using the vehicle cannot be certain about its VED status (the chances of one not being taxed is next to nil, but we are talking a fleet of nearly 1000 vehicles here, so anything is possible)
Our current database has most of the vehicle information stored already, so in theory I think I only need to add a couple of fields, which will make the table structure (roughly):
Is it possible that when a Form (not related to the table, and most likely the main switchboard form) is opened that both the MOTExpiry and VEDExpiry dates are checked, and if either or both of them are due to expire within 7 days or have already expired that a warning appears (vbaOKOnly messagebox would do fine) stating that there are vehicles that require their MOT & VED dates to be checked and updated accordingly)?
Using Access 2010.I purposely disabled the Access Objects to open when the database opens of fear of someone messing with my data. This works. The problem I'm having is when I use the print button (access macro) on one of my forms, as soon as i click the button, the "all access objects" window opens on the left side navigation.Is there a setting that will permanately stop this from opening?
I have a form that opens from a different form based on the primary key within the original form. Unfortunately it seems to be opening a new record every time I open the form--not only from the original form but also straight from the sidebar.
The command button that opens the second form from the first uses the following VBA:
This exact coding worded perfectly in a similar set of forms that I had created; the only difference is a change in the form name & primary key field.
Add onto this, I think that the code DOES work, but then it immediately opens another new record. When I open the second form from the command button, then change to Design View, the form's Filter property is set to [Event_ID]=X (where X is the proper key from the first form) and Filter On Load is set to Yes. The X in the Filter changes accordingly when it changes in the first form. Also, every time I open the form a new record is added to the underlying table.
I've tried setting "Allow Additions" in the second form to No, but then when I open the form nothing appears. Literally; the entire form is blank, no labels, textboxes, combos, buttons or anything. When going to Design View it's still all there.
I've also checked the On_Load, On_Current & Form_Current events and found nothing. I even deleted them and the problem still occurred.