I got an error msg on form with closing. I have a main form (SalesReturnOrDamaged) and subform (SalesReturnOrDamagedSubform).
i have used a VBA code on main form Close Command button as per shown in Code Tag. But that is not working and shown an error msg as per screenshot. how to change that VBA code for empty form close without save the record?
Code: Private Sub Close_Click() On Error GoTo Err_Close_Click If Forms![SalesReturnOrDamaged]![SalesReturnOrDamagedSubform].Form![ItemCode].Value = "" Then Forms![SalesReturnOrDamaged]![SalesReturnOrDamagedSubform].Form![Product].Value = "" Forms![SalesReturnOrDamaged]![SalesReturnOrDamagedSubform].Form![MRP].Value = 0 Or ""
Hi, i have a problem with a form, i don't know how to make a reference to a form property. The code is the following:
Private Sub cmdCautare_Click() Dim strSQL As String, strOrder As String, strWhere As String strSQL = "SELECT tblDosare.DosarID, tblDosare.DenumireDosar, tblDosare.CodDosar, tblDosare.DataDosar, tblInstante.Localitate, tblStadiu.Data, tblStadiu.Stadiu FROM tblInstante INNER JOIN (tblDosare INNER JOIN tblStadiu ON tblDosare.DosarID = tblStadiu.Dosar) ON tblInstante.InstantaID = tblDosare.Instanta" strWhere = "WHERE" strOrder = "ORDER BY DosarID" If Not IsNull(Me.txtDenumire) Then strWhere = strWhere & "(DenumireDosar) Like '*" & Me.txtDenumire & "*'" End If Forms!frmRezultateCautare.RowSource = strSQL & " " & strWhere & "" & strOrder DoCmd.OpenForm "frmRezultateCautare", acNormal End Sub
The problem is on this line: Forms!frmRezultateCautare.RowSource = strSQL & " " & strWhere & "" & strOrder The error message is the following: MS Access can't find the form 'frmRezultateCautare' referred to in a macro expression or Visual Basic code. The form contains a list and is used to display the search results w.r. to the criteria from a main search form. If anyone can help i will apreciate it.
I have a problem with some errors on a form/query that has been running circles around me for 4 hours now on a saturday night!!
Im trying to implement an error control message when a user does not select an employeeID on the main form, whilst they are on the subform. But with no joy! Also, I run into errors when a user enter the same item twice on the same subform! Access exclaims that there are duplicate values.
Please look at the simple access db attached and use the "acq" form. Maybe someone out there can enlighten me coz in all honesty im stumped!!
I have been asked to amend an error occuring on a database which uses a QBF form to filter items in a very large table. The problem which is occuring, from what I can see, is that the first record in the table is automatically visible in the combo box which is used to select the filters.
If then someone changes the field in a combo box to filter on a different area the first record (ID) in the table is automatically edited.
I assume it is something to with Bound and unbound but dont know enough about access to know how to do it.
How can I allow users to select different options from a combo box without it amending data in the table.
I have created a subform where you select a vendor from a combo box and this then allows you to view all software of the selected vendor in a tabular view. When I use this form and then try to go into design view or close the form, i get the following error message:
'The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again'
I have tried removing the index and changing the index to permit duplicates but this has not worked.
Could anyone tell me abit more about this error and how to get rid of it?
I have a button that opens another form to enter data on. But when I click the button I am getting the error msg: "Can't find project or library." And the debugger goes to the following sub routine and highlights Date in 3rd line(tried to bold).
This only happens on 1 user's machine. The other 4 computers open it flawlessly. All 5 have the same setup/security. Don't know why it works on 4 and not the last one. Any ideas?
(Access97.) Private Sub Form_Open(Cancel As Integer) Dim x As Long Me.txtEntryDate.Value = Date Me.lblErrMsg.Caption = ""
Set rsVASRate = PTdb.OpenRecordset("SELECT * FROM tblVASRateCodes", dbOpenDynaset) x = 0 Do Until rsVASRate.EOF VASRate(x).RateCode = rsVASRate(0) VASRate(x).UnitFactor = rsVASRate("UnitValue") VASRate(x).CartonFactor = rsVASRate("CartonValue") x = x + 1 rsVASRate.MoveNext Loop
VASRateTableCount = x - 1
rsVASRate.Close
DoCmd.RunSQL ("DELETE * FROM tblVASData") 'clear VAS data summary table
If TableExists("tblVASEntry") Then DoCmd.RunSQL ("DELETE * FROM tblVASEntry") 'clear VAS data entry table Me.subform_VASEntry.Requery Else DoCmd.RunSQL ("CREATE TABLE tblVASEntry (VEID IDENTITY PRIMARY, 'Rate Code' INTEGER, Units INTEGER, Cartons INTEGER);") End If
I have a form with most of the fields being date fields. If I put a text box instead of DTpicker it works fine but when I use DTpicker it gives me an error like this "Can't set value to NULL when checkbox property = FALSE". And also when I use DTPicker it inputs time also which I don't like. I want only short date to be inputed in the table. Any idea why it is doing so. Can you please help me with this. Also suggest me if this is the right way of inputing data to the table or should I use ADO's or DAO's concept to input the data in the database.
I have to generate some reports based on this form. Could anyone suggest me please.
My repair form pulls data from the vendor table to display the vendor information. Whenever i try to open the repair form, it gives me a popup first that says "enter the extention number" regardless of entering data or pressing cancel my form gets displayed.
When i enter a number (a random number) it wil populate my extention field along with all other data. And when i dont enter any number and hit the cancel button, it populates all data except the extention field, that has nothing to do with the number that i enter but is the one stored in the vendor table.
I am confused what to do with this Can anyone help me
I've encountered another stumbling block. My form is almost done except for some minor details. However, one calculation does not work even when I use the correct terms.
This calculates the tuition balance per customer based on data from 2 subforms on the main form: sbfTuitionAccount and sbfTuitionPayment.
My formula is =Nz(sbfTuitionAccount.Form![txttotaltuitionpayable])-Nz(sbfTuitionPayment.Form![txttotaltuitionpaymenttotal])
I've counterchecked all form and control names, however, when I test it, I only get a '#Error ' in form view. A similar formula has proven functional in another form. Do you have any ideas as to what the problem is?
I have a form with 22 data fields. There are 4 entry flow paths. (1) is 1 to 9, 10, 20 to 22 (2) is 1 to 9, 11 to 14, 20 to 22 (3) is 1 to 9, 15 to 17, 20 to 22 (4) is 1 to 9, 15 to 17, and stop at 19. If information is in Field 10, then I need to prohibit entry in the other 3 paths. How can I do this?
I am trying to set up a statistics summary of my database. Part of this is the number fo records counted in a query for various queries. I found this on the forum:
To show the number of records returned by a query, you can use the DCount() function.
Put a text box on the form. Put this in the Control Source property of the text box (using the correct query name):-
=DCount("*","queryName")
I have made a blank, unbound form and added a text box using this syntax above (with my query name).
However, I get an error in the box '#Name?' when I run the form.
Does anyone know how to get rid of this kind of error (see attached), because I don't know what it means & have never seen it before. It happens everytime I try to close a certain form (but only happens on this one form).
In my form, when I open it, I get the following messages.
The expression On Load you entered as the event property setting produced the following error: A problem occured while Microsoft Access was communicating with the OLE server or ActiveX Control.
Also happen On Click, and once I'm in the form and try to navigate or print button I keep getting the same message............What did I do wrong, I've been making form for years?
Hello All I have an issue I am trying to resolve and I need some help.
I have a database that I just created in access and pulled in data from an old Approach database.
When I try to do a filter on Form it gives me an error and closes out. I sent the error report to Microsoft and they said to intall the updates. I did that and restarted and still I have the issue of not being able to filter on the form. I have other forms in this database and I can do it on them, but not on the main form.
I'm creating a simplified timecard entry form, and everything works perfect except one thing. When I start a new record and go to the subform and choose the day (monday - friday) it says "This property is read-only and cannot be set" but then it goes ahead and accepts the entry.
A little background, I am making the times as simplified entry (100 for 1pm, 800 for 8am, 500 for 5pm) no colons will be entered. Our hours of operation are roughly 7am until 630pm, with the occassional clock in before 6am and clock out up until 8pm or so. I have this error checking in place, it works ok, I add 1200 to the time if it is pm. Now if they are making a straight time adjustment, they enter it in as well.... for instance 8 for 8hrs holiday pay or paid time off. All this stuff works, that's not the problem.
I am thinking, maybe it might have something to do with having 4 or 5 fields set as the combined primary key on the table that holds the time/adjustment data. The reason I did the combined primary key is so they could enter in the same name, the same start date, even the same day, but the adjustment/time value has to be unique when it is compared with the start date, name, day, adjustment/time value. This table is the subform.
The weird thing is, that after the error, it lets the value stand and does not show the error again, as long as you are on this recordset. If I go back into that record and start a new entry below the others, I get the error again. While the error has no detrimental effects on the db, it is annoying.... and it still shows if I run the form off a macro with setwarnings to false.
I am including the database for review for those of you brave enough to try to understand my logic I'm sure it's something simple. I don't see anything in the properties for the form to turn off error messages like you can in data access pages, or maybe I just overlooked it. I have left one recordset in to show the functionality, it all works according to plan. This is just a rudementary database, I will fine tune it after I get past this hurdle.
Edit: I have Calendar control 11.0 for the start date, but this isn't the problem as it still did it when I had the actual field showing. That, and if you see the disparity between hours and minutes and paid time, it's because if they worked so many hours, 1/2 hour is automatically subtracted. Which is why there is a lunch adjustment field.... if they didn't take a lunch or if they took too long of a lunch.
Hello every one, it is great to find a place like this.
Please I need help. When I print a form from Access 2000, all the fields on the printed form show #Error, eventhough in the screen the fields show information.
1.i trapped error 3314 and other errors at my custm buttons(save,edit...) but... at my 2 forms(one single and the other continuous, access gives me an error about an empty field in a table (primary id), when i press tab (it moves to next record). The same action has my continuous form when i click at an empty field at next record or pressing tab with empty values at primary fields.
What can i do to post my own messages?
2. I have a text box (a) that takes value form an other text box (b): b=2*a. both text boxes send values to a table How can i prevent user from chanching the value on (b) text box?
thanks in advance Dimitris Greece (sorry for my bad english)
below is the code I am using to update multiple records on a sub form so that QtyReceived=QtyOrdered when you click the ReceiveButton, now my understanding of VBA is a little limited and the code I'm using won't work in my main form "frmReceiving" only in the subform "frmReceivingSubform" can anyone see what I'm doing wrong?
Private Sub ReceiveButton_Click() Dim rs As DAO.Recordset
Set rs = Me.frmReceivingSubform.RecordsetClone
With rs
.MoveFirst
Do While Not .EOF If rs("QtyReceived") = 0 Then .Edit rs("QtyReceived") = [QtyOrdered] .Update End If .MoveNext Loop
I am making a simple tabular form to use as a subform in another.
The form has a cbo box (cboItem_Name) Quantity (txtQuantity) Price (txtItem_Cost) Extended Price (txtExtended_Price)
Selecting an item in the combo puts the price in txtItem_Cost. Default for Quantity is 1. Control Source for txtExtended_Price = [txtQuantity]*[txtItem_Cost] and gives me my extended price.
I have a control in the footer of the form called txtSub_Total. It's Control Source =SUM([txtExtended_Price]). This Sub Total box generates the #error.
Can anyone tell me why? Do I need to do some other magic with my txtExtended_Price control instead of a simple calculation, like I have?
The AfterUpdate for txtQuantity = Me!txtExtended_Price = Me!txtItem_Cost*Me!txtQuantity, which puts the extended price in the control.
In the FOOTER of the form, I have txtSub_Total. It's Control Source is: =SUM([txtExtended_Price]).
As far as I can tell from reading, when placed in the form footer and used in 'continuous form' layout, this ought to give me the total cost of ordered items.
Instead, I am getting #error. Can anyone help me with this?
I have a form that contains a field with an On Click event procedure to send the value in that field to a corresponding field on a subform attached to another form. Does that make any sense? The On Click procedure looks like this:
I’m not quite sure what I am doing wrong. I am getting the Run-time Error ‘2465’ and it is pointing out that it is unable to find field ‘fsubSubFormName’. I have double (and triple) checked the names and I have not misspelled the names of the form or subform. Did I set up the event incorrectly? Could it be that I am not calling the subform the correct way? Any ideas? .....
I want to create a report using the data currently held in a form. I found this bit of code somewhere: DoCmd.OpenReport "report", acViewPreview, , "[job number] = " & txtFilter.Value
txtFilter is the name of textbox containing the data I want for the report. This works if in the table for txtFilter's data the field is set to a number. But if I set this field to text it comes up with a data type mismatch error. How do I solve this? (sorry new to access and vba). The reason I want to set it as a text field is so that I can limit the number of characters entered.