Results 1 to 7 of 7
  1. #1
    tjuk123 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    3

    Opening specific invoice from command button

    Firstly, i hope this is posted in the right place.

    I have very little access experience and so have been looking on the internet how to modify an existing database template to meet my needs.

    I am trying to create a command button that sits on the order details page and that will open up a report i have created called 'picklist' which is basically the same as an invoice but with some different product information listed on it.

    I want the command button to open up the picklist that corresponds to the order that i am on e.g picklist #2 for invoice#2

    I have 2 issues/questions:

    1) I have seen this code on the internet -

    DoCmd.OpenForm "SecondFormName", , , "FieldName = #" & Me.ControlName & "#"

    Would this work for me if i was to modidy it to:

    DoCmd.OpenForm "PickList", , , "InvoiceID = #" & Me.[txtID] & "#"

    2) Where do i input this code? If i click on the 'onclick' in the properties form im presented with this page (attachment):Click image for larger version. 

Name:	accessscreenshot.JPG 
Views:	15 
Size:	80.9 KB 
ID:	17381

    Hope this makes sense.


    Thanks





  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    If InvoiceID is type number then

    DoCmd.OpenForm "PickList", , , "InvoiceID = " & Me.[txtID]

    You could place it behind a command button in its click event.

    While in Design View of your form, highlight your Command Button. Take a look at the Event tab in the property sheet. Click the ellipses (...) next to the On Click event and select Code Builder.

  3. #3
    tjuk123 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    3
    Hi itsme

    Where do i select code builder from? It just opens up straight into the page that is in the pic above.

  4. #4
    tjuk123 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    3
    I think ive worked out why - is it because its a web database

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Correct, web forms do not support Visual Basic code. You will need to create a Web Macros to automate your web forms. Also, I believe Web Forms have been deprecated starting with Access 2013. I believe Access 2013 requires a Share Point site/list in order to build a Web App. I tried to find the list of deprecated items in Access 2013 but cannot.

    Unfortunately, I have little to no experience with Macros and no experience with Web Forms.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    The action you want to select in the macro is OpenForm. Then fill in the boxes in the macro
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    <snip>I tried to find the list of deprecated items in Access 2013 but cannot.
    @ItsMe, I did find these sites:


    Discontinued features and modified functionality in Access 2013
    http://office.microsoft.com/en-us/ac...102749226.aspx

    Differences Between Access Versions 2003 Thru 2013, Any Version
    http://www.utteraccess.com/forum/Dif...-t2009685.html

    Changes in Office 2013
    http://technet.microsoft.com/en-us/l...ice.15%29.aspx

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

Similar Threads

  1. Replies: 5
    Last Post: 05-10-2014, 12:25 PM
  2. Replies: 2
    Last Post: 11-01-2013, 09:57 AM
  3. Replies: 10
    Last Post: 02-12-2013, 05:04 PM
  4. Replies: 5
    Last Post: 01-15-2013, 07:28 PM
  5. Opening new Tab with command button
    By JFo in forum Access
    Replies: 2
    Last Post: 09-12-2011, 01:45 AM

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