Function Problem 12-07-07

Hello...ok I have a form with a button that I am trying to get to call on a 
function. I have been able to do this and the funtion processes but I keep 
getting an error. Now, the funtion works perfectly if I run it from the 
switchboard/menu, but when run from the form button I get this error:

"The action or method requires a Table Name argument"

Here is the code I have:

Private Sub Update_All_Records_Click()
On Error GoTo Update_All_Records_Click_Err
    DoCmd.OpenFunction Public_Income_Update_Step_1
Update_All_Records_Click_Exit:
    Exit Sub
Update_All_Records_Click_Err:
    MsgBox Error$
    Resume Update_All_Records_Click_Exit
End Sub

Can anyone tell me what might be wrong with this? Am I calling on the 
funtion incorrectly? Any help or suggestions agian will be gratly 
appreciated. Thank you for your time!

-- 
Randy Street
Rancho Cucamonga, CA
0
Utf
12/7/2007 7:05:00 PM
access 16762 articles. 3 followers. Follow

2 Replies
1220 Views

Similar Articles

[PageSpeed] 14

On Fri, 7 Dec 2007 11:05:00 -0800, Randy wrote:

> Hello...ok I have a form with a button that I am trying to get to call on a 
> function. I have been able to do this and the funtion processes but I keep 
> getting an error. Now, the funtion works perfectly if I run it from the 
> switchboard/menu, but when run from the form button I get this error:
> 
> "The action or method requires a Table Name argument"
> 
> Here is the code I have:
> 
> Private Sub Update_All_Records_Click()
> On Error GoTo Update_All_Records_Click_Err
>     DoCmd.OpenFunction Public_Income_Update_Step_1
> Update_All_Records_Click_Exit:
>     Exit Sub
> Update_All_Records_Click_Err:
>     MsgBox Error$
>     Resume Update_All_Records_Click_Exit
> End Sub
> 
> Can anyone tell me what might be wrong with this? Am I calling on the 
> funtion incorrectly? Any help or suggestions agian will be gratly 
> appreciated. Thank you for your time!

You have a function named "Public_Income_Update_Step_1" and you wish
it to do whatever it is it does?

Private Sub Update_All_Records_Click()
On Error GoTo Update_All_Records_Click_Err
    Call Public_Income_Update_Step_1
 Update_All_Records_Click_Exit:
     Exit Sub
 Update_All_Records_Click_Err:
     MsgBox Error$
     Resume Update_All_Records_Click_Exit
 End Sub
 
 The word Call above is optional.

By the way, a function returns a value, i.e. MyVariable =
MyFunctionName().
 I'm guessing you wish to perform an action. 
 Public_Income_Update_Step_1 should be a Sub Procedure, not a
Function.
-- 
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
0
fredg
12/7/2007 7:36:59 PM
Duh! Thanks Fred! I feel like an idiot! I thought I had tried that already 
and it didn;t work so I tried this other way. I retried the "call" and of 
course it worked. 

Thanks for your assistance! Have a great day/weekend & holiday!
-- 
Randy Street
Rancho Cucamonga, CA


"fredg" wrote:

> On Fri, 7 Dec 2007 11:05:00 -0800, Randy wrote:
> 
> > Hello...ok I have a form with a button that I am trying to get to call on a 
> > function. I have been able to do this and the funtion processes but I keep 
> > getting an error. Now, the funtion works perfectly if I run it from the 
> > switchboard/menu, but when run from the form button I get this error:
> > 
> > "The action or method requires a Table Name argument"
> > 
> > Here is the code I have:
> > 
> > Private Sub Update_All_Records_Click()
> > On Error GoTo Update_All_Records_Click_Err
> >     DoCmd.OpenFunction Public_Income_Update_Step_1
> > Update_All_Records_Click_Exit:
> >     Exit Sub
> > Update_All_Records_Click_Err:
> >     MsgBox Error$
> >     Resume Update_All_Records_Click_Exit
> > End Sub
> > 
> > Can anyone tell me what might be wrong with this? Am I calling on the 
> > funtion incorrectly? Any help or suggestions agian will be gratly 
> > appreciated. Thank you for your time!
> 
> You have a function named "Public_Income_Update_Step_1" and you wish
> it to do whatever it is it does?
> 
> Private Sub Update_All_Records_Click()
> On Error GoTo Update_All_Records_Click_Err
>     Call Public_Income_Update_Step_1
>  Update_All_Records_Click_Exit:
>      Exit Sub
>  Update_All_Records_Click_Err:
>      MsgBox Error$
>      Resume Update_All_Records_Click_Exit
>  End Sub
>  
>  The word Call above is optional.
> 
> By the way, a function returns a value, i.e. MyVariable =
> MyFunctionName().
>  I'm guessing you wish to perform an action. 
>  Public_Income_Update_Step_1 should be a Sub Procedure, not a
> Function.
> -- 
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail
> 
0
Utf
12/7/2007 8:12:01 PM
Reply:

Similar Artilces:

Access security problem
I have access file not open because of security . i have the access file and the MDW file too so i want to know how to open this file and see the tables and the data The easiest way is to set up a shortcut to open the .mdb file using the .mdw file. The Target entry in the shortcut needs to be of this form: "FullPathFileNameToAccess.exe" "FullPathFileNameToYourDatabase" /WRKGRP "FullPathFileNameToYourSecurity.mdw" Here's a real example of mine: "C:\Program Files\MicrosoftOffice2003\OFFICE11\MSACCESS.EXE" "C:\Documents and Settings...

Problem using '=' with System.Type
Hi I have the following code; ByVal MyType As Type Dim frame As StackFrame If frame.GetMethod().DeclaringType = MyType Then Problem is I am getting the "Operator '=' is not defined for types 'System.Type' and 'System.Type'." error on the last line. How can I fix this? Thanks Regards Am 23.03.2010 02:27, schrieb John: > Hi > > I have the following code; > > ByVal MyType As Type > Dim frame As StackFrame > If frame.GetMethod().DeclaringType = MyType Then > > Problem is I am getting the "Ope...

help #12
i cannot access my emails ...

Access Import Problem
I am trying to import an excel spreadsheet into Access 2002 w/SP3 loaded. All goes well until it actually starts the import then I get the following error: "You entered an expression that has an invalid reference to the property |." Does anyone know what causes this or how to fix it? I saw alot of posts that talked about coding errors but this is a simple import. Thanks for your help ...

Problem with msFlexGrid
I'm using an msFlexGrid in my VB6 program. Have it set up with 4 columns. The Format property is set to "<|<|<|<". I'm displaying records from an Access database: looping down thru the db, adding rows to the grid. Everything works fine with one exception: If the string being displayed in the 4th column begins with a number, the string is right-justified - in spite of the format specification. (If it begins with a letter then it's left-justified as it's supposed to be). Now, FWIW, I'm using this same grid in another part of the program to ...

Newly Created Function not Working #3
Thank you Frank, I used your suggestion but I still was unable to ge this to work. This is actually the method I had already used. Would i be easier to just save this as an addin and have him install the addi on his machine? Do you think it may work if we do this? Again thank yo for oyur help -- nuve ----------------------------------------------------------------------- nuver's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1003 View this thread: http://www.excelforum.com/showthread.php?threadid=26961 I'll just chime in and give my $0.02 for what it's...

Please add attachment functionality to the campaign wizard
When creating a campaign with a quick campaign or a full campaign it would be really handy to be able to add an attachement to an email task, so that on the bulk send the recipiant would recieve a defined liturature sample, currently this is pretty hard to do -- Alistair 2B.net http://www.crmdeployment.co.uk ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in ...

Problem with voting buttons
I am learning Outlook 2003 on my home computer, and I have Outlook set up to use my two email accounts. If I'm writing a message and I click the Accounts toolbar button to change from my default email account to the other account, the two spaces that normally appear above the automatic signature dissapear, so the cursor ends up on the same line as my signature. Is there a way to keep this from happening when selecting the non-default email account to send an email? Set up a signature for that account that does what you want it to?=20 --=20 Sue Mosher, Outlook MVP Author of C...

Group and Ungroup problem
Hi, I use a reporting tool which takes data from our financial system and creates lovely Excel workbooks. I'm currently witting a report to budget some revenue over the next 12 months with the ability to drill-down from the Cost Centre down to the clients level. To do this I have used the grouping feature of Excel which works nicely however when I group and then ungroup a section any hidden rows that where hidden in the original list are revealed. An example, if my spreadsheet is setup like this R1 Cost Centre Name and Total Line R2 Client 1 Name and Totals R3 Client 1 codes (HID...

Having problems with window sizing on a protected workbook
Hi all, I'm new to the forum and have some questions. I created a workbook for my shop that basically has simple macr functions that take you from sheet to sheet. The problem I'm having is when I protect the workbook, then re-open th workbook the window that displays the info is too small and is coverin some comments and a little text. How do I resize this window to suit my needs? Thanks Jo -- Message posted from http://www.ExcelForum.com Hi what window do you mean? -- Regards Frank Kabel Frankfurt, Germany > Hi all, > > I'm new to the forum and have some qu...

"Virus scanner has detected problem with the file"
I recently downloaded Office 2003 from a CD-Rom that Microsoft sent me after signing up at a conference. I previoulsy had Office installed on my laptop, and had saved many Excel files. However, now that I have downloaded this new version of Excel 2003, I can no longer access my old Excel files. When I try to open these older files, I receive the error message "The file cannot be opened because your virus scanner has detected a problem with the file." I do have Norton Internet Security installed, but I cannot figure out if that is the problem, or if the Excel 2003 has prevented older...

ciao 12-06-07
ciao robi cm va???? ...

File Size #12
What is actually make the excel file bigger? can anybody help me how to reduce the file size? Many thanks, Hi you may try: http://www.contextures.com/xlfaqApp.html#Unused "Jus" wrote: > What is actually make the excel file bigger? can anybody help me how to > reduce the file size? Many thanks, > > > ...

Read Only Problems
WinXP Home on PC and Laptop Excel 2002 on PC and Excel 2003 on Laptop Home PC used to store documents. When using laptop to retrieve Excel files over home network, all files, when opened, are marked READ ONLY. When those same files are pulled up on PC, they ARE NOT read only. Suggestions? "tginapp@houston.rr.com" wrote: > WinXP Home on PC and Laptop > Excel 2002 on PC and Excel 2003 on Laptop > Home PC used to store documents. > When using laptop to retrieve Excel files over home network, > all files, when opened, are marked READ ONLY. > When those same files...

LIne chart problem
I'm trying to set up a simple supply and demand chart in Excel 2007. I've done this many times with past versions but can't get this to work in 2007. Basically I want the price of the product on the y-axis (can't MS call it that, please?) then supply to run upward with the number of products on the x-axis and demand to run downward. I can't get the price on the y-axis no matter what I try. I've looked everywhere online, but switch row/column and using a secondary axis don't work. This should be so simple. Argh! -- Thanks, Shane Devenshire "Fru...

Bottom double border not functioning properly
I have Excel 2002. I have placed a "bottom double border" icon on my toolbar. When I click on that icon, I get a "bottom border" which is a single border. I am, however, able to format the cell with a bottom double border if I use the cell format border function. I have used the bottom double border icon successfully many times in the past on other computers and with other versions of Excel. Any ideas? Thanks, Jim Kirby It's a bug. The following thread has a suggested workaround: http://groups.google.com/groups?threadm=3C59F286.DB7C606A%40msn.com JI...

problems with Plus
When I fired up Plus, it appeared to convert my file (from 2005) just fine. After I did an online sync, however, the machine set at 100% cpu consumption and the status in the upper right was "Updating your accounts...". It never quits. I've tried: 1) repairing my file prior to doing first online update, as well as killing msmoney.exe and doing a repair afterward. no dice. 2) canceling online services and establishing them again. no dice. After multiple attempts, starting with my 2005 file on multiple occasions, I've finally given up and gone back to 2005. Any sugg...

XML Transform problem #2
I'm trying to transform an xml file that contains empty short elements like the following: <element attrib="abc"/> using the XmlTransform class. But I cannot seem to preserve the short format as everytime it get's converted to the longer format of: <element attrib="abc"></element> I need to preserve the shorter format, has anyone else had this problem or got a solution? thanks Hello! > I'm trying to transform an xml file that contains empty short elements like > the following: > > <element attrib="abc"/>...

CRM and Exchange 12-17-04
Hi everybody, I'm a newbie in CRM, but I'm learning about it. I've got a scenario in which I have to create an ActiveDirectory subdomain. In this subdomain I have to install MS CRM. Do you know if I have to install Exchange in the same subdomain? Alternatively can I manage this by using the mail router of CRM to connect to the Exchange in the main domain? Would this work without installing exchange in the subdomain? Thanks a lot. davide Your exchange installation does not need to be in the same domain as your CRM installation. You will have some challenges around the user accoun...

Problem importing data to Money 2006
I'm importing data from Money 2000 into 2006 and the dates and quantities of investment transactions are not transferred. I exported multiple accounts within a file with File/Export and changed the file names to reflect the account names (with .qif after them) to a removable flash drive. Followed import instructions (File/Import), set up multiple accounts and moved them as a group. The transfer appeared to be successful except date and quantities were not present. Any ideas? -- leahn In microsoft.public.money, leahn wrote: >I'm importing data from Money 2000 into 2...

CButton with Icon in DLL Problem
I have some code that I used in VC++ 6.0 for an app. Now I have a VS.NET 2003 and things aren't all working for one of my DLLs. I have a CDialogBar derived class with buttons on it. This class, and icons, are stored in a DLL. With VC++ 6, I used this code to put the icons on the dialog bar, but that doesn't seem to work now. Can anybody help me out? HINSTANCE hInstResource = AfxFindResourceHandle(MAKEINTRESOURCE(IDI_GRAPHIC_BIN), RT_GROUP_ICON); HICON icon = ::LoadIcon(hInstResource, MAKEINTRESOURCE(IDI_GRAPHIC_BIN)); ((CButton *)GetDlgItem(IDC_GRAPHIC_BIN))->SetIcon(icon); --...

Out of Office Problem
I'm pretty sure this is going to end up being a client side issue, but it just seems very odd. We have one user whose Out of Office message cannot be delivered to external recipients. It doesn't matter if it is activated from OWA or from the Outlook client. The OOF will be send to any account inside our domain but does not hit any external addresses. Exchange 2003 SP2, 1 Front End server, 2 Back ends. Any thoughts on what could cause this? Hi, Is allow out of office checked on the advanced tab? On your server, drill down to the Global Settings, and click on Internet Message ...

Average function assistance
I need help with developing an average function for a golf league. We use an avarage of the last 5 scores posted to develop the person's handicap. Each week a new score is added to the data and a new average calculated with the 5th oldest score being dropped and newest score being included in the average. The data is kept on the worksheet in rows. Because a golfer may miss a week, some rows may have blanks that should not be considered. For example a person's scores may look like this for the season: 45, 47, blank, 44, 48, 46, blank, 49 (the 45 is the earliest score and 49 is th...

list function
I have 10 student names put in from cell a1 to a10 in sheet1, and their age put in from b1 to b10. I created a list of student names by selecting cell a1 to a10. I go to sheet2, cell a1: I created a drop drop list of student name. I want cell b1 in sheet2 to auto pop up the age of whoever I choose from the drop down list in cell a1:sheet2. The age is according to the age entered in sheet1. What is the exact formulas for me to this in cell b1:sheet2 or is this possible at all? =IF(A1="","",VLOOKUP(A1,Sheet1!$A$1:$B$10,2,0)) -- Regards, Peo Sjoblom &q...

Outbox #12
Hi: I have a problem where when I send e-mails with attchments it remains in the Outbox, Can anyone help with this. Thanks in advance Regards: Bruno ...