+ Reply to Thread
Results 1 to 7 of 7

controlling a access form from excel

  1. #1
    Forum Contributor
    Join Date
    03-27-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    290

    controlling a access form from excel

    Here is what I would like to do...

    I have a database dump which has includes a reference number I can use to in a form on the database, when I click a button on the form, it gives me all the information related to the reference number.

    I want to be able to click a button on excel which launches Access, input the number into the field in the form and then hit the search button...

    Im having problem with inputting the number into the field, here is what I currently have:

    Please Login or Register  to view this content.
    when I am in access I can just use something like this to show me the value:
    me.IDCode.Value

    however i cant do that in excel, anyone know the correct syntax?

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: controlling a access form from excel

    Does this form run a query/report with the value as a parameter?

    If it does why not bypass the form and go straight to the query/report?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    03-27-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: controlling a access form from excel

    Quote Originally Posted by Norie View Post
    Does this form run a query/report with the value as a parameter?

    If it does why not bypass the form and go straight to the query/report?
    the form is used to log data in different stages, if you search for a reference number it is also used to update the existing data which is stored in a back end which is locked for end users. The form has the ability to record or update records if it passes the tests required at different stages.

    so the reason is simplicity for the end user to only be using one interface to access all information no matter what stage. (certain parts of the information show depending on the stage the record is at, so all for example, "introduction" status wont show the completed date.


    The database dump I have is from a query but some end users do not understand or need to understand how queries work which is why everyone just uses a front end.

    u know, all these posh sounding business words "harmonisation, fluidity, elegent solution"...

    complicated answer for a simple question i know... XD

  4. #4
    Forum Contributor
    Join Date
    03-27-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: controlling a access form from excel

    Please Login or Register  to view this content.
    so i have this... but I dont have anyway of running the "Search" button macro.
    the button has a macro named "Command10_Click" however i dont know how to run it from excel

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644
    You could move the code for the button's click event to a standard module.

    Then you should be able to use Application.Run, replacing Application with the name of the Access instance in the code.

    Actually when I think about it you might need to change the code too, hard to tell for sure without seeing it.

  6. #6
    Forum Contributor
    Join Date
    03-27-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: controlling a access form from excel

    hmm... yeah i just tried to move some code to a standard module but its not gone to well....

    the procedure references a function in the original module and the me. commands no longer work... there must be an easier way, even if it means targetting the button and then hitting enter.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644
    Can you post the code?

    If you are using Me in it you should be able to replace it with Forms![NameOfForm].

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1