Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    gdhaliwal is offline Novice
    Windows 10 Office 365
    Join Date
    Jul 2024
    Posts
    10
    can you give me an example of the code.


    pardon me for my weak knowledge of access.

  2. #17
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,269
    Code calling the form. This form shows various data depending on what is passed in, Weekly, Monthly etc.
    Code:
    Private Sub cmdMonthly_Click()
        DoCmd.OpenForm "frmPeriod", , , , , acDialog, "Monthly"
        'Forms!frmPeriod.ConfigureForm ptMonthly
    End Sub

    Then Form Load
    Code:
    Private Sub Form_Load()
    ' Add which period we are showing to form title label
    If Not IsNull(Me.OpenArgs) Then
        Me.lblTitle.Caption = Me.lblTitle.Caption & Me.OpenArgs
        Me.RecordSource = "qry" & Me.OpenArgs
    End If
    DoCmd.GoToRecord acDataForm, Me.Name, acLast
    End Sub
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. hiding a button on a report line
    By StuartR in forum Reports
    Replies: 2
    Last Post: 02-23-2018, 01:30 PM
  2. Replies: 2
    Last Post: 04-29-2016, 09:06 PM
  3. Replies: 6
    Last Post: 02-26-2016, 05:28 AM
  4. Use cmd button to fill textbox
    By shariq1989 in forum Forms
    Replies: 1
    Last Post: 07-19-2012, 08:59 AM
  5. Button hiding when filter on
    By rstonehouse in forum Forms
    Replies: 2
    Last Post: 08-25-2010, 06:24 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