Results 1 to 9 of 9
  1. #1
    Chris1112 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    31

    Open Form, Pass RecordSource, Position Form Appropriately


    I am attempting to create a "notes" form/subform for multiple fields. There is no real room on the form for these notes. What I would like is to have the form open when the field is double-clicked with the recordsource set appropriately and the form placed just to the right of the field that was double-clicked.

    Opening the form is no problem. Setting the recordsource and placement of the form is what I'm not so sure how to do.

    Thanks

  2. #2
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Opening the form based on the recordsource is easy.

    Code:
     
    
    DoCmd.OpenForm "YourFormName", , , "[RecordSource]='" & Me!ReocrdSourceOnForm & "'"

    Placement is an issue I know nothing about. I just Auto Center smaller forms and include a "Close" button on them. That's in the Format tab of the Property Sheet in the smaller form.

  3. #3
    Chris1112 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    31
    I'm kinda confused as to the meaning of "RecordSourceOnForm". Would I use something like:
    Code:
    SELECT qryCAData.LenderNotes, qryCAData.JobFROM qryCAData
    WHERE (((qryCAData.Job)=[Me]![Job]));
    Or could I just use that as a fixed record source and have it work properly?

    Thanks for the help.

  4. #4
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    RecordSourceOnForm was referring to whatever the text box name was. I guess I should have used TextBoxName.

    In the code I provided, replace [RecordSource] with [Job] and Me!RecordSourceonForm to Me!Job. Brackets aren't required for Me!Job.

  5. #5
    Chris1112 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    31
    It is working but I have two more questions now.

    First, There is an unbound textbox on the new form. When I use this code, it errors out saying that it isn't bound to a table or query.
    Code:
    Private Sub Form_Open(Cancel As Integer)    Me!txtNotes.ControlSource = LenderNotes
    End Sub
    Second, the field is a memo field set to rich text. How do I place the rich text controls (font, size, bold, etc.) onto the form for users?

    Thanks again.

  6. #6
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    First - Try setting the box to have the Default Value of LenderNootes, unless that needs to be a bound field.

    Second - Working on it.

  7. #7
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Second - Found the below tidbit. Basically, it's sort of like working in Excel - the window will pop up to allow editing of the text but doesn't explain how to include the bar in the window. It is available in the ribbon, though.

    When you edit a rich text field, whether in Datasheet view or in Form view, you can apply formatting options by using the commands on the Mini toolbar or in the Font and Font Alignment groups on the Home tab. First, you select the text that you want to format, then you apply the formatting options.
    When you use the mouse to select text in a memo field that supports rich text, the Mini toolbar appears after you complete your selection and release the left mouse button. The Mini toolbar includes buttons for the most commonly used formatting options.
    Website Link Here

  8. #8
    Chris1112 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    31
    Thanks a ton. The form is working and you've pointed me where I need for the rich text thingy.

  9. #9
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Great! Glad I could help.

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

Similar Threads

  1. Replies: 1
    Last Post: 05-03-2012, 02:25 PM
  2. Get position of record in continuous form
    By Whizbang in forum Forms
    Replies: 3
    Last Post: 11-02-2011, 01:47 PM
  3. Position text boxes on form
    By Mclaren in forum Forms
    Replies: 4
    Last Post: 05-10-2011, 12:24 PM
  4. Replies: 4
    Last Post: 04-22-2011, 03:08 PM
  5. Set Form Position
    By Yance in forum Programming
    Replies: 3
    Last Post: 11-29-2010, 02:20 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