I have a button that opens a form based on a query, the query is filtered based on an input field. This works great except when the user typos what they put into the input field. Since the query pulls no records it just opens a blank form. I want it to not open the form and instead open a message box telling the user the data they entered is not valid and to try again.
Hi people. I'm having fun with this one. I want to open a form frmOldRec from a list on frmSelectOld, only if there is data. I'e tried code such as: Private Sub Form_Load()
Dim rst As Recordset Set rst = Me.RecordsetClone
If rst.RecordCount = 0 Then MsgBox "No Records logged in this service area"
DoCmd.Restore,
'close etc etc
End sub
But I haven't been successful.
As it stands it opens a blank form if there's no suitable record. How can I stop this happening please?
How can i open a form to add a new entry in a blank format. I currently have a button which opens a form but displays the information of previous entries.
I would really like the form to open without displaying any previous entry
HELP When the user double clicks on the icon, the form automatically appears on the screen. That's good. But record number 1 is there. I want a blank record there so they can enter their data. This can't be difficult, but I can't figure it out.
I was wondering if it is possible that when the form is opened a blank record could be displayed rather than the first entry in the table. In other words, it would be like opening a form and clicking the "Add Record" button, a blank record would be displayed and data entry could take place.
In the Purchase Order details form a Supplier has to be chosen via a combo box. Based on that another combo box in the subform displays products only from this supplier (Products table is linked to supplier table).
I managed to let the subform combo show only relevant products using criteria referring to the main form combo box. Also other product data will show accordingly in text boxes. So far so good.
However when I close the form and reopen it the subform combo box is blank, other text boxes still show the right values. If I remove the filter criteria for the subform combo then all fields show all data correctly. (However the combo box is unfiltered again 8-/)
So somehow the 'criteria' prevents the combo to show the value that was previously chosen.
I have created a form based on a query that prompts the user to enter a persons name. Once entered, the persons data appears on the form and some other related data appears in a subform. However, I have found a problem that occurs when a name is entered that doesnt exist on the database... the form opens completely blank!! even text and graphics disappear!
Ok - really need some help here. I have searched and searched but i think my problem is slightly different to the ones i am finding.
Basically i have a form and i want to force users to fill in one out of 4 tick boxes. If none of them are ticked when they press the close button i want the form to stay open and a message box come up.
I can get the message box part to work but the form still closes down.
The reason for this is that when the form closes it goes to another form that is linked to it by a unique ID number. This works by the following code.
Private Sub BTN_INVIS_Click()
Dim stDocName As String Dim stLinkCriteria As String
This code checks the boxes and generates the message box if none are ticked - that works great. However it doesnt stop the second part of the code (the move to the next form) from executing if the boxes arent ticked.
Would really appreciate it if someone could help me - i'm fairly new to coding so the whole database is a bit cobbled together (mostly with help from this forum!).
Is there a way to stop users from opening the front end file twice (stop from having two sessions of the same FE at the same time)?
I've been searching the forum and found this http://www.access-programmers.co.uk/forums/archive/index.php/t-67724.html but since im not using an .exe updater is not my case t.t
I am a new user to Access. I created couple of forms using wizard, but when I view them, they show me all the available data by default. I want to stop this, if anyone can help me plz.
When entering information into a blank form, I would like to be able to continue entering information to another additional blank form after my last entry. Is there a way to continue to a blank form after entering information into the previous blank form? I would just like to continue without having to close the entire form and then reopening another form.
I work on a pre-created Access database, and the other day I was working on it, and was trying to export something to Excel to sort it and do some Pivot analysis.
Anyway, I must have pressed something, because now every time I open the database, rather than saying "record 1 of 20463" and showing the data from record 1, it shows "record 1 of 1" and all the data fields are blank. If I go to "Records" and "Show All Records" they'll all come up, but I don't want to have to do that every time, and as I import and export all the time, I'm worried that the next time I try it it'll mess up the years of data I have.
OK, I have been searching around on the fourm for over an hour now...I give up. If this is some where else, I am sorry.
I have a database of maintenance data. There are several columns that are usually filled in, some records have some columns blank. They are formated text because they hold letters and numbers (see pic).
I am using a form to query the table...no problem. The form has text boxes the user filter down the data
The problem comes are with the results of the query. Any record that has a blank column is not retuned. I am using "Like" so that the user can enter in partial codes. I know "like" won't return "null" records.... Help!
Things I have tried: 1)IIF(form field is blank, return table field, else use like command to filter) - returns nothing! 2)Like "*" & [Forms]![Fleetwide_data_Request]![MAL_CD] & "*" returns all records without blanks (i.e. missing data)
I have a Form opening from Access Options. I would like to close this Form using the Timer. The following is the code I have used but it is not working.
Private Sub Cover_Page_Form_Load() OpenTimer = Timer End Sub Private Sub Cover_Page_Form_Timer() If (Timer - OpenTime) = 5 Then DoCmd.Close acForm, "Cover_Page_Form", acSaveYes End Sub
Next question. If I can get this to work can I then use a DoCmd to open new Form within the code above or do I need a new process.
Using 2010.Would like to open a new form as a popup to display the results of a query. Trying to avoid eliminating objects in my DB, so not wanting to create Query Objects, but just creating the SQL on the fly.
The purpose of opening the popup form is to display the results of the Query based on a Button selection that the user chooses. Not sure if I can pass the Query from Form to Form, or if the called Form should run the Query. The Query output is a single record which is a Memo field, which is why I want to open the new form to display the result. The Memo text can be a page long or more.
I am not getting any errors and can open the form. The problem is that I am not getting the Query results displayed on the new form. The code below is from my first form that has the buttons. The popup form is Results_frm.
Code: Private Sub InScope_bt_Click() Set dbs = CurrentDb strSQL = "SELECT In_Scope FROM Project_Scope_Deliverables" Debug.Print strSQL ResultType = "I" DoCmd.OpenForm "Results_frm" Forms!Results_frm.RecordSource = strSQL End Sub
I have a query linked to some combo/txt boxes on a form so the user defines which categories he/she is looking for then presses button and query comes up with relevant results. This works fine if the user inputs information that is actually there, but if they leave it blank it goes all wrong.
The statements I have in the query are as follows:
[Forms]![frmStockControlSigned]![comboSupplier] [Forms]![frmStockControlSigned]![txtPurchaseOrder] etc.
I thought the solution may be along the lines of this but it does not work: =if([Forms]![frmStockControlSigned]![txtDate]=Null,[Forms]![frmStockControlSigned]![txtDate],"*")
basically i want to make it so the user does not have to enter criteria into evey box, thus if every search box is left blank it would show all records "*"
When a query returns no records, the form appears blank. How can I make the form appear eventhough there are no records to show prior to inputting data.
I have a tabbed navigation form. I have a form on one of the tabs, [tab1frm] that a query that consists of 6 fields that are each from a different query.as the record source. This shows a percentage field, an image field, and a count field for current month and then then the same fields for year-to-date.
The problem is that when there are no records for the current month, the whole form [tab1frm] is blank. I read that if no records are returned this can happen, but since there are always records returned for year-to-date, I don't know why its happening. Is there any way to make blank fields show up or to show the most recent records so the form is never blank?
I have been running the same database on numerous systems for 5 years and the user clicks on a button and using this code;
DoCmd.OpenForm "Employee", acNormal
Simple !, this always opened this form blank, without applying filters, ready to accept a new employees details.
But now this no longer works, for no apparent reason? What happens is that it opens with the form fields filled with the first person in the Databases details instead of being blank.
The only thing that could have changed is that i converted the database to 2003?
I am setting up a generic form template that will enable me to maintain data in a standardised way. All generic code is stored in a module. There is very little code specific to the table being maintained. Much of the form functionality is determined by data held in supporting tables therefore data driven.
When a form is loaded a commonly named query is created that is used as the Record Source of the form. This query only ever returns one record and uses the value of textbox on the form as criteria in the unique id field.
Despite immediately creating the query in the Open event of the form, Access tries to process the form first and returns an error as the Record Source query applies to another form, the one last opened.
How can I create the query before anything on the form is referenced / processed without creating it before the form is opened?
Hi I've been having this same problem for a while and I've had a bit of help here but none of the suggestions have so far worked.
Basically I need a way to stop people tabing through a sub form without entering data. The sub form has a check box that has to be checked (it can't be set as True as default) the required field doesn't work and for some reason the Enforce Referential Integrity on the join between the main table (tblCustInfo) and this one doesn't work either.
tblCustInfo = the main form tblAgentData = subform