Page 1 of 3 123 LastLast
Results 1 to 15 of 45
  1. #1
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389

    Coding help!!!!


    I have created a dashboard on which there is a child form named dashchild.
    When the New Offer button on the dashboard is clicked, the offer_entry form opens on the dashchild form due to the code written in it.
    Similarly, by clicking on the Register button, the form created in the navigation bar should open in the offerregister dashchild form.

    But there is a list box in the formofferregister in which I have written a criteria in the offer ID field in the record source which is generating a popup error.
    Please help me. Just like the form offerregister is opening in split view in independent form, similarly I want to open it in split view on dashchild form created on dashboard.
    Thank you.
    Attached Files Attached Files

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,514
    Try this:
    Remove the RowSource property of List132.
    Use the following code in the OnCurrent event of formOfferRegister:
    Code:
    Me.List132.RowSource = "SELECT GREY_SHADE.OfferID, GREY_SHADE.Shade, GREY_SHADE.Meter FROM GREY_SHADE WHERE (((GREY_SHADE.OfferID)= " & Me.[offerid] & "))"

    EDIT

    Alternatively, you could just change the RowSource property of List132 to:
    SELECT GREY_SHADE.OfferID, GREY_SHADE.Shade, GREY_SHADE.Meter FROM GREY_SHADE WHERE (((GREY_SHADE.OfferID)=[OfferID]));
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Bob Fitz View Post
    Try this:
    Remove the RowSource property of List132.
    Use the following code in the OnCurrent event of formOfferRegister:
    Code:
    Me.List132.RowSource = "SELECT GREY_SHADE.OfferID, GREY_SHADE.Shade, GREY_SHADE.Meter FROM GREY_SHADE WHERE (((GREY_SHADE.OfferID)= " & Me.[offerid] & "))"

    EDIT

    Alternatively, you could just change the RowSource property of List132 to:
    SELECT GREY_SHADE.OfferID, GREY_SHADE.Shade, GREY_SHADE.Meter FROM GREY_SHADE WHERE (((GREY_SHADE.OfferID)=[OfferID]));
    Thanks bob Out of the two codes you suggested, the first one is doing perfect.
    Should I keep or remove the me.list132.requery code in the on current event of the form offer register?
    As I had asked earlier, how can I see the form offer register in split view on the dashchild form created on the dashboard.
    Thank you for help.

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,514
    You won't need the requery with the first option but You would with the second option.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Bob Fitz View Post
    You won't need the requery with the first option but You would with the second option.
    Thanks please also tell how can I open it in "split form view" on dashchild form.

    Form Offer Register Close button is also not working properly when it is clicked the entire dashboard gets closed. Please suggest any proper coding for this also.
    Thank you.

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,514
    Quote Originally Posted by deepaksharma View Post
    Thanks please also tell how can I open it in "split form view" on dashchild form.

    Form Offer Register Close button is also not working properly when it is clicked the entire dashboard gets closed.
    Sorry, but I don't use dashboards.
    If I were developing the db I would have whatever subforms I needed on the main form and change their Visible property with buttons on the main form.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  7. #7
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Thanks I will wait for other experts like you here

  8. #8
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,514
    Quote Originally Posted by deepaksharma View Post
    Thanks I will wait for other experts like you here
    Thank you for your kind words but I'm not an expert.

    On reflection, I think I might use a Main Menu form for the buttons to do everything else.

    Perhaps something like the file attached.
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,752
    Did you simply set SourceObject property?

    Parameter in List32 SQL will not work. So it will work when form is standalone or subform, modify to:
    SELECT OfferID, Shade, Meter FROM GREY_SHADE WHERE OfferID=[OfferID];
    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.

  10. #10
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by June7 View Post
    Did you simply set SELECT OfferID, Shade, Meter FROM GREY_SHADE WHERE OfferID=[OfferID];
    Don't know why but this method is not working.
    Would you also please suggest any solution to the two problems I have mentioned above.
    Thanks in advance.

    Thanks please also tell how can I open it in "split form view" on dashchild form.

    Form Offer Register Close button is also not working properly when it is clicked the entire dashboard gets closed. Please suggest any proper coding for this also.
    Attached Files Attached Files

  11. #11
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,514
    Use:
    Code:
    Private Sub Form_Current()    'Me.List132.Requery
        Me.List132.RowSource = "SELECT GREY_SHADE.OfferID, GREY_SHADE.Shade, GREY_SHADE.Meter FROM GREY_SHADE WHERE (((GREY_SHADE.OfferID)=" & [offerid] & ")); "
    End Sub
    I don't think split forms work on a subform. You may have to use stand alone forms like the forms in the db that I attached in post #8
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  12. #12
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Bob Fitz View Post
    Thank you for your kind words but I'm not an expert.

    On reflection, I think I might use a Main Menu form for the buttons to do everything else.

    Perhaps something like the file attached.
    Your suggestion is good but I want to proceed as is.

  13. #13
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,514
    Quote Originally Posted by deepaksharma View Post
    Your suggestion is good but I want to proceed as is.
    Perhaps I can persuade you not to use Access Split Forms with the following YouTube link: https://www.youtube.com/watch?v=UloLIMhatSs
    Watch it all. In the second half he shows how to create an alternative.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  14. #14
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    [QUOTE=Bob Fitz;519112]Use:
    Code:
    Private Sub Form_Current()    'Me.List132.Requery
        Me.List132.RowSource = "SELECT GREY_SHADE.OfferID, GREY_SHADE.Shade, GREY_SHADE.Meter FROM GREY_SHADE WHERE (((GREY_SHADE.OfferID)=" & [offerid] & ")); "
    End Sub
    Now this code is working well please tell which one will be the best among these three.

    Code:
     Me.List132.RowSource = "SELECT GREY_SHADE.OfferID, GREY_SHADE.Shade, GREY_SHADE.Meter FROM GREY_SHADE WHERE (((GREY_SHADE.OfferID)= " & Me.[offerid] & "))"
    Code:
     SELECT OfferID, Shade, Meter FROM GREY_SHADE WHERE OfferID=[OfferID];
    June's code not working right now.

    Code:
    Private Sub Form_Current()    'Me.List132.Requery
        Me.List132.RowSource = "SELECT GREY_SHADE.OfferID, GREY_SHADE.Shade,  GREY_SHADE.Meter FROM GREY_SHADE WHERE (((GREY_SHADE.OfferID)=" &  [offerid] & ")); "
    End Sub

  15. #15
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,514
    [QUOTE=deepaksharma;519115]
    Quote Originally Posted by Bob Fitz View Post
    Use:
    Code:
    Private Sub Form_Current()    'Me.List132.Requery
        Me.List132.RowSource = "SELECT GREY_SHADE.OfferID, GREY_SHADE.Shade, GREY_SHADE.Meter FROM GREY_SHADE WHERE (((GREY_SHADE.OfferID)=" & [offerid] & ")); "
    End Sub
    Now this code is working well please tell which one will be the best among these three.

    Code:
     Me.List132.RowSource = "SELECT GREY_SHADE.OfferID, GREY_SHADE.Shade, GREY_SHADE.Meter FROM GREY_SHADE WHERE (((GREY_SHADE.OfferID)= " & Me.[offerid] & "))"
    Code:
     SELECT OfferID, Shade, Meter FROM GREY_SHADE WHERE OfferID=[OfferID];
    June's code not working right now.

    Code:
    Private Sub Form_Current()    'Me.List132.Requery
        Me.List132.RowSource = "SELECT GREY_SHADE.OfferID, GREY_SHADE.Shade,  GREY_SHADE.Meter FROM GREY_SHADE WHERE (((GREY_SHADE.OfferID)=" &  [offerid] & ")); "
    End Sub
    I believe that I've answered this in post #11.
    I do not use split forms. If you are adamant about using them, then I am unable to offer any more help. Good luck with your endeavours.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Page 1 of 3 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. VBA IF NOT Coding
    By Grant Shea in forum Access
    Replies: 4
    Last Post: 09-12-2016, 02:41 PM
  2. Vb Coding Help
    By GarageConcepts in forum Access
    Replies: 1
    Last Post: 03-10-2016, 05:05 PM
  3. VBA Coding Help please
    By cfobare79 in forum Programming
    Replies: 6
    Last Post: 12-07-2014, 07:54 PM
  4. Need help in VBA coding
    By Kcgp in forum Programming
    Replies: 6
    Last Post: 02-01-2012, 11:22 PM
  5. Bar-Coding
    By texasprincess7 in forum Access
    Replies: 1
    Last Post: 02-12-2009, 10:29 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