Results 1 to 11 of 11
  1. #1
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727

    Split Form

    Just wondering if there is a way to lock the rows and columns to prevent the user from changing the size of the column or row? I set the form splitter bar to be off so the user can't change that. Just having trouble finding out how to lock the row and column sizing.



    Thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    None that I know of. Should not matter if this is a split database. Whatever user does will be wiped out with the next version of the frontend.
    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
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    It was for printing purposes. I was thinking of changing the print preview button to a DoCmd.PrintOut button instead. This is because if I can't get a fix on the print preview situation I'm having, then I was going to just do away with the print preview and have the datasheet all set up nicely so the user can just click the print button and everything will already be adjusted to fit perfectly on a sheet of paper.

    If the user is able to adjust the size of the rows and columns then it may not print out the way I would like and the user will not be able to see what its going to look like before they print since I am doing away with the print preview feature and replacing it with just a printout feature. This will only come to pass if I can't get answer to my first choice which is being able to open print preview in a modal, or something similar, format.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    As answered in other thread, report does have modal and popup properties and will apply to PrintPreview.

    I recommend not printing a datasheet form, even if it is a direct to printer output, print report.
    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.

  5. #5
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    Ok June7 I need your magic expertise once again.

    Right now I got a few filters going on in the split form with the print preview button that I mentioned above. There are five different unbound text boxes, each with their own label. Also each with their own filter button. Then I have a clear all filters button. The user can only use one filter at a time so I know that this system is not the best set up but it does get the job done for what I need it to do.

    Now for my situation. Since you are telling me to use reports to print, I want to try this. I want to continue using this split form because it has all the filters I need to search for records. So I changed the print preview button to open up the report instead that is bound to the split form to pull in the records from. However it is pulling EVERYTHING. Even after I do a filter first then click the button to open the report, it still pulls in ALL the records. I would like it to be associated with the records that are shown whether I do a filter or not.

    In other words, if I do a filter and it shows 1 record, then I want to click the button to open the report and have it show only the 1 record to print. If I don't do a filter at all, then I would like to click the button to open the report and have it show ALL the records. How do I go about doing this?

  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,632
    It is possible to apply multiple parameters to filter form or report.

    One approach is to have the report (or form) RecordSource be a parameterized query.
    http://www.datapigtechnologies.com/f...mtoreport.html

    What I do is use VBA to build filter criteria and pass it to the report with WHERE CONDITION of OpenReport.

    This article shows code building filter criteria. http://www.allenbrowne.com/ser-62code.html

    However, if you want only one record and there is a unique ID, just use the ID as parameter.

    Another technique is to set the report RecordSource to the form's RecordSource.
    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
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    Ok the last suggestion about setting report to my split form's record source makes the most sense to me however if I remember correctly, I don't think I saw that property. I think I only saw control source but I'll check again. Ultimately I want my split form to continue being the source to look up the records as needed then when user sees the records in this split form that they want to print, they can just click one button to take them to the report to print what they last had on the split form. Is that possible? I have 5 filtered unbound text boxes at the top if the split form with the datasheet at the bottom. User types in data into the unbound text boxes then clicks a filter button. The datasheet below then shows the records that fit what they typed into the text box. Then I want a button to open the report from there showing what was last in the split form in the datasheet section.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Of course is possible. I presented several approaches. I normally use the WHERE CONDITION argument. I have used the last technique only once. I never use dynamic parameterized queries.
    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.

  9. #9
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    Here are the five unbound text boxes with a filter command button for each on the this split form:

    Private Sub cmdClerkInitial_Click()

    Me.Filter = "[Clerk_Initial_DL] Like '*" & Me.txtFilterClerkInitial & "*'"
    Me.FilterOn = True
    Me.Requery

    End Sub

    Private Sub cmdFilterDate_Click()

    Me.Filter = "[Todays_Date_DL] Like '*" & Me.txtFilterDate & "*'"
    Me.FilterOn = True
    Me.Requery

    End Sub

    Private Sub cmdFilterDLNumber_Click()

    Me.Filter = "[DL_Number_DL] Like '*" & Me.txtFilterDLNumber & "*'"
    Me.FilterOn = True
    Me.Requery

    End Sub

    Private Sub cmdFilterLicensingState_Click()

    Me.Filter = "[Licensing_State_DL] Like '*" & Me.cmbFilterLicensingState & "*'"
    Me.FilterOn = True
    Me.Requery

    End Sub

    Private Sub cmdFilterName_Click()

    Me.Filter = "[RE_Name_DL] Like '*" & Me.txtFilterName & "*'"
    Me.FilterOn = True
    Me.Requery

    End Sub

    Now I am trying to work on the button that opens the report and I do not know what to type for the where condition. I don't know how that works. This is what I have so far:

    Private Sub cmdReport_Click()

    DoCmd.OpenReport "DL_Clearance_Report", acViewReport

    End Sub

    Right now I have the record source to the query which I created using the wizard and its a simple query with no criteria or anything. Everything is dependent on the filters I made in the split form which is also bound to the simple query. So how do I make the report open based on what the split form shows? Whether the user does a filter or not. I want the report to reflect what the split form shows for the user to print.

    Please help.

  10. #10
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    Found the answer online. Here is what you need for the button to open report:

    Dim strWhere As String
    If Me.Dirty Then Me.Dirty = False
    If Me.FilterOn Then strWhere = Me.Filter
    DoCmd.OpenReport "Report1", acViewPreview, , strWhere

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    And that is the fourth method I forgot to mention. Glad you figured it out.
    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. Get split form behaviours without using a split form
    By SyntaxSocialist in forum Queries
    Replies: 2
    Last Post: 04-12-2013, 11:56 AM
  2. Replies: 3
    Last Post: 05-02-2012, 10:13 AM
  3. Help with a split form.....Please!
    By Kevo in forum Forms
    Replies: 3
    Last Post: 02-22-2012, 06:32 PM
  4. Replies: 1
    Last Post: 12-12-2011, 01:58 PM
  5. Modifying a Split Form?
    By robertrobert905 in forum Access
    Replies: 0
    Last Post: 10-26-2010, 08:00 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