Error When I Use My Form

May 10, 2005

HI when i use my form I get the following error when i use one part of it. The error is

You can't reference a property or method for a control unless that control has focus


Can't someone help me please

Thanks
Chris Lynch

View Replies


ADVERTISEMENT

Modules & VBA :: Error Msg On Form With Form Closing?

Nov 13, 2014

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 ""

[code]......

View 1 Replies View Related

Form Error!!!!!!

Nov 1, 2006

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.

Thanks

View 1 Replies View Related

Error On Form!! HELP!

Mar 5, 2005

Hello Access World Pros!

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!!

Cheerz :D

View 2 Replies View Related

QBF - Form Error

Mar 11, 2005

Help

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.

Ange

View 2 Replies View Related

Error When Using A Sub-form

Mar 20, 2006

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?

Many Thanks

View 2 Replies View Related

#error On Form

Nov 29, 2004

I Cannot Seem To Understan Why My Formulas On My Form Keep Giving Me The #error Message....

View 3 Replies View Related

Error In Total On Form

Mar 16, 2008

Okay, I know this is probably simple, but I am getting an error in putting a total on a form. I have the following:

Subform name is EntryDetail Subform
I have a field in the footer called TotalEntry that calculates the total entry. The formula is =sum([EntryAmt])

Form name is Entry
I have a textbox with the control =[Entry Subform].Form!TotalEntry

The text box shows #Name?

I am attaching a copy of the database.

Any ideas?

View 3 Replies View Related

Error When Opening Form

Jan 26, 2005

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 = ""

CurrentRateCode = ""
CurrentUnitFactor = 0
CurrentCartonFactor = 0

Set PTdb = CurrentDb()
Dim rsVASRate As Recordset

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

End Sub

View 1 Replies View Related

Form DTpicker Error

Mar 31, 2005

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.

Any suggetions on this form it would be great!!

Thanks
vs

View 4 Replies View Related

Opening Form Error

Apr 6, 2005

Hi

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

thanks

View 4 Replies View Related

Error With Form Calculation

Apr 21, 2005

Hi!

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?

Thanks!

View 1 Replies View Related

How Do I Error Trap A Form

Aug 23, 2005

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?

View 1 Replies View Related

DCount On Form - Error

Oct 27, 2005

Hello,

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.

Any suggestions?

View 8 Replies View Related

Error Can't Find Form.

Jul 26, 2006

Why is this telling me it can not find the form?

Private Sub booleanInScope_Click()
[booleanInScope] = Forms![subfrmCoordinatorApproval]![txtID]
End Sub

The form is in the forms and I can open it in form view

View 1 Replies View Related

Error When Trying To Close A Form...

Oct 23, 2006

Hi,

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).

any help would be appreciated.

View 3 Replies View Related

MS Assecc Form Error

Dec 15, 2004

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?


Thanks Gary

View 6 Replies View Related

Error When Doing Filter On Form

Oct 26, 2006

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.

Does anyone have any ideas?

View 6 Replies View Related

Error Message On Form

Jan 7, 2008

Hi all,

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.

View 3 Replies View Related

#error On The Fields When Printing A Form

Feb 11, 2005

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.

Can somebody help me????

Thank you

View 2 Replies View Related

Error 3314 Can't Trap In A Form

Jul 13, 2005

Hi, this a great forum and i'm asking for help :)

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)

View 14 Replies View Related

RecordSetClone Coding Error On Form

Aug 14, 2005

Hello

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

.Close

End With

Set rs = Nothing
End Sub

Thanks

View 3 Replies View Related

Simple Form Totalling Error

Sep 2, 2005

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?

Thanks for any help you can give a novice.

View 2 Replies View Related

Form Footer Calculation Error

Sep 6, 2005

I have a simple tabular form with the following:

cboItem_Name
txtItem_Cost
txtQuantity
txtExtended_Price

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?

View 13 Replies View Related

Runtime Error 2465 On Form

Feb 14, 2006

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:

Private Sub FieldNameonCurrentForm_Click()

Forms!frmMainFormName!fsubSubFormName.Form!txtFiel dName = me.FieldNameonCurrentForm

End Sub

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? .....

View 1 Replies View Related

Opening A Report From A Form Error

Feb 28, 2006

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.

Thanks
Chris

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved