Results 1 to 10 of 10
  1. #1
    Swilliams987's Avatar
    Swilliams987 is offline Need Not Be Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2011
    Location
    Sacramento, CA
    Posts
    29

    Auto Fill Issue #2

    I saw the most recent post on autofill, but I wasn't able to follow it. I'm thinking that what I want to learn is frequently done, but I can't seem to find the answer anywhere.

    I have a form: frmNewPermit. They primary key on this form is atnpermit.

    On this same form, I have a macro that, when clicked, displays another form based off of another table to enter in notes. This form is called frmNotes. The primary key is also an atn. I need atnpermit from frmNewPermit to automatically fill the lngPermitNumber field on frmNotes.



    Would anyone be kind enough to offer a suggestion?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,912
    Not being a fan of Macros I can only offer this link: http://www.baldyweb.com/OpenArgs.htm
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  3. #3
    Swilliams987's Avatar
    Swilliams987 is offline Need Not Be Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2011
    Location
    Sacramento, CA
    Posts
    29
    Thank you for your response, however, I'm not quite sure how to make that work. Perhaps what I want to do doesn't exist.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,912
    It most certainly can be accomplished in code but I do not know how to do it in a Macro.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  5. #5
    Swilliams987's Avatar
    Swilliams987 is offline Need Not Be Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2011
    Location
    Sacramento, CA
    Posts
    29
    I only need to pass one field.

    So would this be the code I would use in the general part of the main form?
    DoCmd.OpenForm "frmNotes", , , , , , Me.EmpID
    OR
    Does it stay looking like this:
    DoCmd.OpenForm "frmOpenArgs", , , , , , Me.EmpID

    And would this go in the other form?
    If Not IsNull(Me.atnpermitnumber) Then
    strOpenArgs = Split(Me.atnpermitnumber)
    Else
    Me.txtOtherInfo = "Unknown"
    End If

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,912
    This is the way you open then next form:
    DoCmd.OpenForm "frmNotes", , , , , , Me.EmpID
    ...and this is in the OnLoad event of the Next form
    Code:
    If Not IsNull(Me.OpenArgs) Then
      Me.TheControlYouWant = Me.OpenArgs
    End If
    ...using *your* TheControlYouWant name of course.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  7. #7
    Swilliams987's Avatar
    Swilliams987 is offline Need Not Be Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2011
    Location
    Sacramento, CA
    Posts
    29
    where exactly does the docmd go?

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,912
    I woud say where this takes place:
    Quote Originally Posted by Swilliams987 View Post
    On this same form, I have a macro that, when clicked, displays another form based off of another table to enter in notes. This form is called frmNotes. The primary key is also an atn. I need atnpermit from frmNewPermit to automatically fill the lngPermitNumber field on frmNotes.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  9. #9
    Swilliams987's Avatar
    Swilliams987 is offline Need Not Be Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2011
    Location
    Sacramento, CA
    Posts
    29
    VICTORY!!!!!! Thank you so much!

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,912
    Glad I could help.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

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

Similar Threads

  1. Auto-Fill names
    By jlclark4 in forum Forms
    Replies: 10
    Last Post: 12-13-2010, 03:04 PM
  2. Auto-Fill
    By sophiecormier in forum Programming
    Replies: 3
    Last Post: 10-02-2010, 08:29 AM
  3. Auto-fill in datasheet
    By Terence in forum Database Design
    Replies: 2
    Last Post: 03-18-2010, 03:42 PM
  4. Auto Fill-In Capability?
    By bbarrene in forum Access
    Replies: 3
    Last Post: 01-15-2010, 08:35 AM
  5. Auto fill a table?
    By newtoAccess in forum Access
    Replies: 3
    Last Post: 11-21-2009, 08:21 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 - Senior Forums