Page 1 of 3 123 LastLast
Results 1 to 15 of 35
  1. #1
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91

    Subform question

    I have a subform within a form which is a receipt. In the subform I have a text box where a clerk can enter a number (1 thru 6) which correlates to a table (districts) with a field [district] numbers (1 thru 6). I want to display the next field in the table which has the cost [charge] for a service in that district. I don't want to add any records to this table (districts) but I do want to total multiple charges onto the receipt. Any suggestions?



    Thanks
    Wayne

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    what you're looking for is a simple dlookup() function, Wayne. Check that function out.

  3. #3
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91
    OK, I have been searching for dlookup...I came up with: =DLookUp("[Charge]","Districts","[District])=" & [CaseNumber Subform1]![DistrictTextBoxEnter])
    This only returns: #Name (not to useful).

    The user enters a number (1 thru 6) into a text box (DistrictTextBoxEnter). I want another text box to display a $amount from field [Charge] table (Districts) that the user entered number relates to in field [District].

    Thanks
    Wayne

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    very close Wayne. try something like:
    Code:
    =DLookUp("[Charge]","Districts",
    
    "[District] = " & me![DistrictTextBoxEnter])
    sometimes the "me" indicator does not work this, which I have never understood.

    If that doesn't work, you might have to replace it with the full reference syntax:
    Code:
    forms!subformdistrict1![DistrictTextBoxEnter]

  5. #5
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91
    The "me" indicator definately did not work. This is an expression for a text box, not VB. The current version: =DLookUp("[Charge]","Districts","[District]=" & [Forms]![CaseNumber Subform1]![DistrictTextBoxEnter])

    Does not work either...still that "#Name?"

    Time to surrender?

    Wayne

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Wayne,

    This is one area that I will never figure out how it completely works. The reason I say this is because syntax complexities like this really take a vast amount knowledge about Access and VBA to figure out. The reason is because sometime you simply have to start guessing which one of the 20 different syntaxes will work. There's no rhyme or reason, but MS seriously needs to fix it.

    If you want to upload your actual file, or a dummy file that shows the same issue and structure, I will change it immediately for you. Other than that, I'm going to bow out in helping here, simply because doing it for you will take all but 30 seconds to figure out. And if we keep talking about the possibilities and go through trial and error through this thread, it's going to take another 24 hours at the most the figure out where the bug is.

    So upload your file, and I'll get it fixed for you, or someone else will if I'm not here, I'm sure.

    If you can't do that, I apologize for bowing out.

  7. #7
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91
    This is where I would love to upload my objects, but I can't. I have saved the forms as objects with Access several times then search the computer for them all to no avail. Access does not give me a path choice when I save them. They are not in the directory I am working in. They are not in the default directory for Access. Thay are not on my hard drive. So I am at a loss...How do you save objects with Access?

    Wayne

  8. #8
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    I think you may be a bit confused Wayne. Forms are IN Access. you need to upload the Access FILE as a whole. does that make sense?

    forms are NOT their own applications

  9. #9
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91
    So there is no way to just send the forms I am working on and the related tables? I have to send the entire database? That seems unreasonable.

  10. #10
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    umm...Wayne - Access is a program, and like any other program the objects inside of it can't stand on their own legs.

    so No, if you want me to help in this manner, I have to see the whole file. why not make a dummy file with fake data in it?? it shouldn't take but a few minutes.

  11. #11
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91
    Data is not the issue...just lots of experimental crap in there. I will attach it and hope you can sort through it.

  12. #12
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91
    I think I got it here.

  13. #13
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91
    You are looking for form: RcptDataTest2 and related tables: CaseNumber, Districts, RcptData, and RcptDataJunction.

    Wayne

  14. #14
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Wayne,

    I wont be back to my machine until tomorrow afternoon, so if you havent got help til then, I'll get back to you at that time. thanks

  15. #15
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91
    Aj,

    Any developements on this front?

    Wayne

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

Similar Threads

  1. Pass Subform filter to subform in report
    By camftm in forum Programming
    Replies: 16
    Last Post: 07-19-2011, 07:12 AM
  2. Replies: 15
    Last Post: 11-09-2010, 04:27 PM
  3. Subform Question
    By Desverger in forum Forms
    Replies: 1
    Last Post: 08-11-2010, 02:42 PM
  4. Data from one subform to anther subform
    By scotribs in forum Forms
    Replies: 3
    Last Post: 03-09-2010, 09:53 AM
  5. Replies: 1
    Last Post: 12-10-2005, 04:52 PM

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