Results 1 to 5 of 5
  1. #1
    Jillette is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    2

    Post Command buttons and Code


    Hello to all, I have just registered here. I am relatively new to Access and am having a real problem with command buttons and how to code them!!!!!

    I have a Form [Site_Details] that covers one aspect of data gathering (information on individual sites) and on this form I have 3 Command Buttons [MC_Details] [Pharm_Details] and [PCT_Details] each of which opens their individual forms respectively (Address and contacts info for EACH site) - no problem to open a new form and no problem to open a form that has been filled out. But what I want is to be able to press one of these buttons and open the matching address for the site and if there isnt one for a new form to open. Everything i try seems to either open all new or all exisiting with no new form. this is prob really easy once you know how BUT ITS DRIVING ME MAD!!! Please help.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Are you using macros or VBA? I use only VBA.

    Code would have to check if address in table and if not open the form to NEW record. Question is, why are you opening another form and not doing data entry on the first form?

    Do you want to provide project for analysis? Follow instructions at bottom of my post.
    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.

  3. #3
    Jillette is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    2
    Tried using macros and vba. The idea is to match site id fields (autonumber on [SiteDetails] and manually (cant think of any other way)! inputted on address forms.once data is inputted into both [SiteDetails] and [AddressForms] then no problem matching the site id's. But if their is no matching id (ie it's a new record) the button wont open anything!!!!It is as you point out to check the site id and if not there open to a new record - HOW or WHAT code makes this happen?
    I am doing data entry on the first form but do not want to have hoards of addresses and contact details (from 3 other forms) on it. This is a slightly different type of project - and my [SiteDetails] Form pulls together lots of different info relevant to each site. Please HELP as I am under time pressure to deliver this. Thank you so much

    P.S> I would love to have my project analysed but really need to have data inputting into it ( I am doing this myself at the mo - to iron out all the gremlins) but will have 2 others from next Monday!!!!! OMG - NO SLEEP however, is this possible without losing data (or not much)???

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Suggest you tell us in plain English what your application is about. Show us the layout of your tables.
    Perhaps you could create jpg of your form(s), then tell us exactly what you are trying to do and where exactly the problem occurs.
    We only know what you tell us, and then we must interpret what you have said. So, help us help you, by providing all relevant info.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    To provide project without corrupting your working file, follow instructions at bottom of my post.

    Quite possibly a form/subform arrangement would be a solution.
    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.

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

Similar Threads

  1. command buttons
    By hijack61 in forum Access
    Replies: 4
    Last Post: 11-19-2011, 04:59 PM
  2. Command Buttons
    By BLD21 in forum Access
    Replies: 2
    Last Post: 05-10-2011, 06:27 AM
  3. Command Buttons
    By Rosier75 in forum Access
    Replies: 3
    Last Post: 03-09-2011, 11:59 AM
  4. command buttons
    By nashr1928 in forum Forms
    Replies: 23
    Last Post: 10-15-2010, 04:09 PM
  5. Command buttons
    By maintt in forum Forms
    Replies: 3
    Last Post: 08-03-2010, 09:52 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