Page 3 of 4 FirstFirst 1234 LastLast
Results 31 to 45 of 56
  1. #31
    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

    1. DSum() expression in textbox: =DSum("Meter", "Grey_Shade", "OfferID=" & [OfferID])
    1.Actually, I wanted the report to be shown in the sequence in which the entries are made in the shed and meter sub forms, but if it is working on alpha sort rule then it is fine. there is no problem. Thank you.

    2. I want to select the offer number to print the offers.

    3. As per your suggestion I have removed the criteria from the print query.

    4. As per your suggested filter criteria, I have currently blocked this code from the print button in the offer entry form.
    And instead of this, the PrintSelect form has been set to open which will ask the user for the range of offer numbers to print the offer.

    'DataToFourColumns
    'DoCmd.OpenReport "GREY_OFFER", acViewPreview


    I worked very hard the whole day today on the code given by you and the link given by you but still I am not able to code this print range form (PrintSelect) please help me in this.

    5. Please also explain that instead of all the data of greyshed file being copied in the greytemp file, only the data related to the range of offer numbers which will be entered in the print select form should be copied in the greytemp file. How would this be possible?

    6. The expression you suggested for total meter was not working even after several attempts, after that I added the offer ID field in the print query and added that field to the report, which made the expression work now. now I will set the offer ID text box invisible. thank you very much.

    Please check the attachment
    Attached Files Attached Files

  2. #32
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Hi
    I modified the Preview report Button to now open the report and only show the range of numbers entered.
    Attached Files Attached Files
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  3. #33
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by mike60smart View Post
    Hi
    I modified the Preview report Button to now open the report and only show the range of numbers entered.
    Thank you. Please also explain how this happened. Along with this, also explain that when multiple frontend copies of this file will be created, then a linked copy of the greytemp file will have to be kept in each frontend program or one original copy of the greaytemp file will have to be created on each.
    Thanks again.

  4. #34
    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
    i already said can't have both grey_shade and greytemp in report recordsource.
    [offerid])
    hi june
    please explain note #31 point 5
    thank you!!!!

  5. #35
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    As suggested in post #29, like:

    Set rs = CurrentDb.OpenRecordset("SELECT * FROM GREY_SHADE WHERE OrderID BETWEEN " & Forms!formname.cbxStart & " AND " & Forms!formname.cbxEnd & " ORDER BY OfferID, Greyshadeid")
    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.

  6. #36
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Quote Originally Posted by deepaksharma View Post
    Along with this, also explain that when multiple frontend copies of this file will be created, then a linked copy of the greytemp file will have to be kept in each frontend program or one original copy of the greaytemp file will have to be created on each.
    There is no "linked" copy in frontend. It is an actual table built in the frontend, not a link.
    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. #37
    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
    There is no "linked" copy in frontend. It is an actual table built in the frontend, not a link.
    I have renamed both the text boxes in the print select form "cbxStart" and "cbxStart" put this coding on the OK button.

    'DoCmd.OpenReport "Grey_Offer", acPreview, , "OfferNumber BETWEEN " & Me.cbxStart & " AND " & Me.cbxend

    Now this form is working well but this following coding I could not understand where and when it is used

    Set rs = CurrentDb.OpenRecordset("SELECT * FROM GREY_SHADE WHERE OrderID BETWEEN " & Forms!formname.cbxStart & " AND " & Forms!formname.cbxEnd & " ORDER BY OfferID, Greyshadeid")

  8. #38
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Why oh why would you name a textbox starting the cb?

    If anything I would put that down as an attempt at a combo? Most people would use txt for textbox.
    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

  9. #39
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    My example was presuming a combobox for selecting OfferID from dropdown list. Use whatever names you want for your controls and adjust code accordingly. These are examples. Adapt to your circumstances.


    That Set rs code is in VBA procedure for populating GreyTEMP. Find it and modify. Know your code.
    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. #40
    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
    My example was presuming a combobox for selecting OfferID [/B].
    1. Thank you very much, now I understood that on every frontend program all the tables have to be kept linked but the import copy of the greytemp file has to be kept.

    2. now i am getting the same offer ID range in the print preview which is entered in the offer ID range print select form.

    3. I have updated the code suggested by you in the model. Now the same shades are being copied in the graytemp file whose range's offer ID is entered in the prientselect form.

    Now only one small problem is left that I do not enter the offer ID in the print select form but I enter the range of offer numbers there, so please give your valuable suggestions by modifying the set rs = code to be inserted in the module.
    Thank you.

  11. #41
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I already showed that code in post 29 and 35 (looks like I accidentally type OrderID). Use your actual form and control names, which appear to be:

    Set rs = CurrentDb.OpenRecordset("SELECT * FROM GREY_SHADE WHERE OfferID BETWEEN " & Forms!PrintSelect.txtFrom & " AND " & Forms!PrintSelect.txtTo & " ORDER BY OfferID, Greyshadeid")


    Now where are you calling this procedure? I don't see it in the button macro.
    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.

  12. #42
    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
    I already showed that code in post 29 and 35 (looks like I accidentally type OrderID). Use your actual form and control names, which appear to be:

    Set rs = CurrentDb.OpenRecordset("SELECT * FROM GREY_SHADE WHERE OfferID BETWEEN " & Forms!PrintSelect.txtFrom & " AND " & Forms!PrintSelect.txtTo & " ORDER BY OfferID, Greyshadeid")


    Now where are you calling this procedure? I don't see it in the button macro.
    You are right, you had typed the order ID, I used it as offer ID and it is working properly but I am giving print preview from the offer number field.
    Please see gray offer table there is a field offer number whereas offer id is an autonumber field created to create a table relation.

  13. #43
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    OfferNumber is not in Grey_Shade table. This means the VBA SQL statement will have to JOIN tables to pull data from Grey_Offer.
    Code:
    Set rs = CurrentDb.OpenRecordset("SELECT Shade, Meter, OfferNumber FROM GREY_OFFER INNER JOIN GREY_SHADE ON GREY_OFFER.OfferID = GREY_SHADE.OfferID " & _
                    "WHERE OfferNumber BETWEEN " & Forms!PrintSelect.txtFrom & " AND " & Forms!PrintSelect.txtTo & " ORDER BY OfferNumber, Greyshadeid")
    Modify rest of code to replace OfferID with OfferNumber. Rename field in GreyTEMP.

    Personally, I would prefer to use a combobox to select offer and do all filtering on OfferID.

    Probably should make sure txtTo input is greater than txtFrom. Can use ValidationRule and ValidationText properties to manage that.



    All modules should have Option Explicit in header. Can set VBA Editor to include this automatically with new modules. Tools > Options > check Require Variable Declaration
    Will have to manually add to existing.
    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.

  14. #44
    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
    OfferNumber is not in Grey_Shade table. This means the VBA SQL statement will have to JOIN tables to pull data from Grey_Offer.
    Thank you very much, the more I thank you, the less it would be, because of you, such a complex question has been solved and I have got to learn a lot from you. Now I don't want to bother you any more, but if you tell me how the space interval between the meter and the shed line shown in the report can be increased, it will be very kind of you.
    Thanks again.
    Attached Thumbnails Attached Thumbnails 45Untitled.png  

  15. #45
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    how the space interval between the meter and the shed line
    Increase the line spacing property to be larger than 0"
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Page 3 of 4 FirstFirst 1234 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 06-17-2021, 09:48 AM
  2. Setting a Report Variable with a string
    By Paul H in forum Programming
    Replies: 2
    Last Post: 07-20-2015, 01:12 PM
  3. Setting columns to affect only details
    By trpatrick in forum Reports
    Replies: 1
    Last Post: 03-09-2015, 08:04 AM
  4. Setting named paramater for report
    By gem1204 in forum Reports
    Replies: 1
    Last Post: 07-16-2014, 10:12 PM
  5. Setting default values in columns
    By crownedzero in forum Programming
    Replies: 0
    Last Post: 06-17-2009, 06:45 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