Results 1 to 2 of 2
  1. #1
    MintChipMadness is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    109

    Calling a Private Function from Another Form

    I have an issue with calling a private function in a form from another form. I have never done this before and I am guessing it has something to do with the function being private. What is happening is a user searches for a value in [BoxNo] and clicks a button (Send2Edit). Then the button opens a new form, fills in the value of [BoxNo] in [number] of the DataEntry Form and then closes the original form "SearchContents". My data won't compile at the Call function. Does anyone know how I get this to work? I am very new to the VBA world. Thank you for your help.




    Code:
    Private Sub send2edit_Click()
    
        DoCmd.OpenForm "DataEntry", acNormal
        [Forms]![DataEntry].[number] = Me.BoxNo
        Call [Forms]![DataEntry].[search]
        DoCmd.Close acForm, "SearchContents"
    
    End Sub

  2. #2
    MintChipMadness is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    109
    I found a different way of doing it that works. The private function being called was only a requery so what I did was delete the Call line and replace it with the code below.

    Code:
    Forms![DataEntry].Requery

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Calling a Function From A Form.
    By ksmith in forum Access
    Replies: 2
    Last Post: 06-07-2012, 02:23 PM
  2. Calling fields into VBA Private Sub
    By fullshape in forum Programming
    Replies: 3
    Last Post: 02-18-2011, 09:22 AM
  3. Replies: 9
    Last Post: 12-20-2010, 08:05 PM
  4. Calling A Module Function To Open A Form
    By orcinus in forum Modules
    Replies: 3
    Last Post: 09-29-2010, 04:43 PM
  5. calling function
    By ManvinderKaur in forum Programming
    Replies: 3
    Last Post: 07-22-2010, 10:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums