Page 2 of 4 FirstFirst 1234 LastLast
Results 16 to 30 of 48
  1. #16
    Symlink is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2013
    Posts
    42
    Code:
    = Formulaires![Order_details_sub]![txtPrixTotal] + Formulaires![Order_details_sub]![txtTPSTotal] + Formulaires![Order_details_sub]![txtTVQTotal]
    That part would help me refer to textboxes in other forms right? And you made those textbox names judging by what I would need to do right?

    And I will probably code the IIF(taxable) later on.

    Is there a way to remove the borders like the record brower around the subform ?

    When I open the order_form is there a way to force the record to get an autonumber instead of having to chose the payment_mode to input data ?

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    Yes and Yes.

    Did you get the idea about subform in Continuous view?

    If you do summary calcs in subform Form footer, probably don't need textboxes on main form referencing the subform boxes.
    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. #18
    Symlink is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2013
    Posts
    42
    Yes I did put it in continuous form to use the footer part it's much easier that way.

    I probably edited my last post while you were answering :P

    Is there a way to remove the borders like the record brower around the subform ?

    When I open the order_form is there a way to force the record to get an autonumber instead of having to chose the payment_mode to input data ?
    Also I'd like to thank you very much for your time, patience and expertise you are a very nice person

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    A subform is created by placing a subform container control on another form. The container control has a SourceObject property. The SourceObject can be a table, query, form, report. If it is a form and you don't want navigation buttons, record selector, border then edit the properties of the form.

    Don't really understand question about autonumber and payment_mode. The Order table has Order_ID set as an autonumber field. Order_ID is generated as soon as data is entered in another field.
    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. #20
    Symlink is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2013
    Posts
    42
    Can I force the Order_ID to be generated as soon as the form opens (before the user enters data) because the user could just skip the Payment_mode and no Order_ID would be generated right ?

  6. #21
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    Order_ID will be generated when another field is populated. That's the way autonumber field type works.
    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. #22
    Symlink is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2013
    Posts
    42
    1- I created the report to be able to print the current Order the user is filling. I tried to make a Print button to show the report with only what is currently in the form.

    I tried :

    Code:
    DoCmd.OpenReport "order_report", acViewPreview, , "Order_ID = " & Order_ID
    But that doesn't seem to work.

    2 - Is there a possiblity to just print the report without showing it ? ie. When the user clicks Print it just prints right away and he can keep on making new order w/o having to close a window.

  8. #23
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    Why doesn't it work, what happens - error message, wrong results, nothing?

    Record must be committed to table before it is available for report. Record is committed when form closes, move to another record, or run code.

    DoCmd.RunCommand acCmdSaveRecord

    Direct to printer is the default of OpenReport method. Don't specify acViewPreview, leave that argument blank or use acNormal.
    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. #24
    Symlink is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2013
    Posts
    42
    An error occurs :

    Execution Error '3075'

    Syntax error (missing operator) in expression " Order_ID = "
    ---

    I added DoCmd.RunCommand acCmdSaveRecord before the line DoCmd.OpenReport "order_report", , , "Order_ID = " & Order_ID

    I tried MsgBox (Order_ID) and nothing appears in the message box.

    EDIT :

    I got it to "pass" ie no error with :

    DoCmd.OpenReport "order_report", , , "'Order_ID = " & Order_ID & "'"

    But the problem now is it's showing every order with every product.

    I am also wondering why when I am selecting a payment_mode the subform resets ?
    Attached Files Attached Files

  10. #25
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    You have misused and unnecessary apostrophes in the code. Remove the red characters:

    DoCmd.OpenReport "order_report", , , "'Order_ID = " & Order_ID & "'"

    Apostrophes are used to delimit text values, # is used for date/time. If Order_ID were text instead of number:

    DoCmd.OpenReport "order_report", , , "Order_ID = '" & Order_ID & "'"


    Select payment_mode where?
    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.

  11. #26
    Symlink is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2013
    Posts
    42
    Select payment_mode where?
    Bottom of the Order_form (in the new database I reattached in my last post)

    You have misused and unnecessary apostrophes in the code. Remove the red characters:
    If I remove the red chars from the command line you reposted so it becomes :

    DoCmd.OpenReport "order_report", , , "Order_ID = " & Order_ID


    I get the same error as before 3075 missing operator in expression Order_ID =

  12. #27
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    Must initiate parent record on main form first. This happens when data entered into a field on main form. The date DefaultValue does not initiate record. The autonumber Order_ID is generated as soon as payment type is selected. The code to open report works when parent record is initiated.

    The table relationships are not enforcing referential integrity. This permits records in Order_details without a parent record in Order. The subform 'resets' because you are entering data in subform before initiating parent record. This results in 'orphans' in Order_details.
    Last edited by June7; 07-10-2013 at 10:40 AM.
    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.

  13. #28
    Symlink is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2013
    Posts
    42
    Alright so I must add referential integrity in my relationships between order_details and Order. I will try to google that.

    I suspect there is no way to keep the data in the subform if I initiate the record in the main form after right?

  14. #29
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    The data entered into subform is saved because there is no referential integrity enforced. The records are orphaned because the parent was not initiated first.

    To set referential integrity - in the Relationships window, click on the line linking tables to open the Edit Relationships window. Check the Enforce box.
    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.

  15. #30
    Symlink is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2013
    Posts
    42
    It is working One last question (sorry :P)

    If I create the report with Order_ID, Order_date, Payment_mode, Product_ID, Quantity, Description, Prix everything is fine.

    But when I try to add information on the report from the company_info table (because it's needed) it says I need to link them (add a relationship). I can't seem to understand why I need a link there because basically it's only 1 entry. If I do need a relationship I don't know which one to use because basically you have 3 options 1- one that joins both tables only where both fields are the same 2- All info from table 1 and only the matching info from table 2 3- vice versa. There is a part of the relationships (and especially the necessity in this particular case to have those relationships) I am not getting.

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

Similar Threads

  1. medical billing software
    By sabrina in forum Access
    Replies: 2
    Last Post: 03-09-2017, 05:45 AM
  2. time and billing DB
    By gpnhmiller in forum Access
    Replies: 4
    Last Post: 12-31-2012, 04:27 PM
  3. Please help on creating simple billing db
    By emttrr in forum Access
    Replies: 7
    Last Post: 12-05-2012, 02:12 AM
  4. Medical billing Database Design
    By Ray67 in forum Database Design
    Replies: 5
    Last Post: 08-22-2012, 11:36 AM
  5. Free Billing Application
    By khalodaaa in forum Access
    Replies: 1
    Last Post: 06-23-2007, 05:43 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