473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

I am recieving 424 - Object Required error. What to do?

Hello.
I've written a small program in MS Access 2007 that calculates how many goods left in stock in 3 different units. For example, I have a product that has 3 units of measurement: gr,kg and Piece (P). There are 1000gr in 1kg and 3.5kg in 1P. I'm collecting amounts in minimal units in this example in grams. I want the program to show me the result in all 3 units as there are 4770gr left in my stock. I have a query "mal_hereketi_tam" that calculates how many left in minimal unit. And I tried to write a function code in a module to be able to use in all my reports. I will provide the field names of the query as function's arguments, but the code raises "424 - Object required" error as a result. But it must show 1P1kg270gr. The experimentary piece of my module function is:
Expand|Select|Wrap|Line Numbers
  1. Public Function gir_data(Miqdar, u1, u2 As Double, ed1, ed2, ed3 As String, R1 As Integer) As String
  2. On Error GoTo sehv
  3. Dim AAA, BBB, CCC As Double
  4. Dim Baza As Database
  5.  
  6. Set Baza = CurrentDb
  7. AAA = Fix(Abs(Miqdar) / u1 / u2)
  8. BBB = ((Abs(Miqdar) / u1 / u2) - AAA)
  9. CCC = BBB * u1 * u2
  10.  
  11. If (Miqdar Is Null Or Miqdar = 0) Then
  12.     gir_data = Null
  13.     Exit Function
  14. ElseIf (Miqdar < 0 And R1 = 1) Then
  15.     gir_data = "-" & Abs(Miqdar) & ed1
  16.     Exit Function
  17. ElseIf (Miqdar < 0 And R1 = 3) Then
  18.     gir_data = "-" & AAA & ed3
  19.     Exit Function
  20. ElseIf (Miqdar > 0 And R1 = 3) Then
  21.     gir_data = AAA & ed3
  22.     Exit Function
  23. End If
  24.  
  25. Cixis:
  26.     Exit Function
  27.  
  28. sehv:
  29.     'gir_data = Err.Number & " - " & Err.Description
  30.     gir_data = Round(AAA, 3) & ed3
  31.     Resume Cixis
  32.  
  33. End Function
  34.  
Dec 27 '10 #1
0 956

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Apostolis K. | last post by:
At first I make a independend virtual directory wich I named app and I check Directory Browsing in the Virtual Directory Properties. Then I create with notepad global.asa and index.asp ...
3
by: News Groups | last post by:
Dear Group I am trying to use the following code to refer to a form and control on my form. I am supposed to be using VBSCRIPT for this code. I always get an "object required: 'document' " error:...
1
by: contact | last post by:
Hi, I'm trying to use the following to replace a text string in all the links on a page: var arrLinks = document.links; for(var LinkIterator = 0; LinkIterator < arrLinks.length; LinkIterator++)...
7
by: google | last post by:
I am trying to use the following ASP code to examine the file names in a folder: Dim fso, f, fl, s, fs Set fso = CreateObject("Scripting.FileSystemObject") Set f =...
2
by: RICHARD BROMBERG | last post by:
I am using Access 200. I have a form which includes text boxes L1, L2 and L3 And a table tblGrades with number fields L1, L2 and L3
7
by: imatts | last post by:
Hi can anyone help with this little problem. I have a simple script to swap between two divs on a page. It works perfectly in Firefox & Safari & Opera. It fails in IE 6 giving Object Required error...
4
by: tcnjdeluca | last post by:
Hello I am sorry if this is a really novice question, but I am virtually clueless when it comes to Javascript. I have a page that is running the "leightbox" script. I have modified the script as...
5
by: ash2009 | last post by:
Hi, I am getting an object required error on IE6 Line: 1826 Char:3 Code:0 When I do view Source on my browser: here's what I see for line 1826: function navBarGetMousePosition(e){
5
by: ibrahim Nohbala | last post by:
Hello. I've written a small program in MS Access 2007 that calculates how many goods left in stock in 3 different units. For example, I have a product that has 3 units of measurement: gr,kg and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.