Results 1 to 4 of 4

Thread: Access Database Problems (need some programmers)

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Long Island, NY.
    Posts
    353

    Access Database Problems (need some programmers)

    Here is the Access Database I need help with:

    Database

    user login David with password david

    I am not worried about layout or design, after I get it working right I will create a nice interface, just need help with the following:

    Here are my problems.

    1. When user logs in I want that users name to be displayed on the form (frmSupply) in the Receiver at TMO textbox.

    2. On the form (frmSupply), when a user selects Items belong to:, I want the coresponding RA's info to show up in the RAs Information textbox. Or maybe two textboxes (one RA name, one RA number). This info is all in the Table (tblSquadrons).

    3. On the form (frmSupply) I have a Mail button and Print button (been playing around trying to find a way to email a record) I will change the icons later, for now I am trying anyway possible to send the current records contents by email. I like the way the Print button hyperlinks to email, instead of having to select a format.

    That's it. If I can figure out these problems I would greatly appreciate it. I have no code experience so try to keep it simple.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Long Island, NY.
    Posts
    353

    Re: Access Database Problems (need some programmers)

    cmon anyone please?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Long Island, NY.
    Posts
    353

    Re: Access Database Problems (need some programmers)

    I still need help with #1 question

    Figured out 2 and 3...

    Here is what I did for 2:
    VB Code:
    1. Private Sub txtItems_AfterUpdate()
    2. Dim stWho As String
    3. Dim stWhere As String
    4. Dim varS As Variant
    5. Dim varT As Variant
    6.  
    7. stWho = Me.txtItems
    8. stWhere = "tblSquadrons.strRAsquadron = " & "'" & stWho & "'"
    9.  
    10. varS = DLookup("[strRAname]", "tblSquadrons", stWhere)
    11. varT = DLookup("[strRAphone]", "tblSquadrons", stWhere)
    12.  
    13. Me.txtRAname = varS
    14. Me.txtRAphone = varT
    15.  
    16.  
    17. End Sub

    This is what I did for 3:
    VB Code:
    1. Private Sub Command53_Click()
    2.     On Error GoTo Err_Command53_Click
    3.  
    4.     Dim stWhere As String       '-- Criteria for DLookup
    5.     Dim varTo As Variant        '-- Address for SendObject
    6.     Dim stText As String        '-- E-mail text
    7.     Dim RecDate As Variant      '-- Rec date for e-mail text
    8.     Dim stSubject As String     '-- Subject line of e-mail
    9.     Dim stTracking As String    '-- The tracking number from form
    10.     Dim stReceiver As String    '-- The receiver from form
    11.     Dim stItems As String       '-- The items belong to from form
    12.     Dim stRAname As String      '-- The RA name from form
    13.     Dim stRAphone As String     '-- The RA phone from form
    14.     Dim stContract As String    '-- The contract number from form
    15.     Dim stVendor As String      '-- The vendor from form
    16.     Dim stDescription As String '-- The description from form
    17.     Dim stWho As String         '-- Reference to tblSupply
    18.  
    19.     '-- Who to send email to
    20.     stWho = Me.txtRAname
    21.     stWhere = "tblSquadrons.strRAname = " & "'" & stWho & "'"
    22.     '-- Looks up email address from TblUsers
    23.     varTo = DLookup("[strRAemail]", "tblSquadrons", stWhere)
    24.    
    25.                
    26.     stSubject = ":: TMO Ticket Information ::"
    27.  
    28.     RecDate = Me.txtDate
    29.     stReceiver = Me.txtReceiver
    30.     stItems = Me.txtItems
    31.     stRAname = Me.txtRAname
    32.     stRAphone = Me.txtRAphone
    33.     stTracking = Me.txtTracking
    34.     stContract = Me.txtContract
    35.     stVendor = Me.txtVendor
    36.     stDescription = Me.txtDescription
    37.    
    38.     stText = "Here is the information for the product being received." & Chr$(13) & Chr$(13) & _
    39.              "Received Date: " & RecDate & Chr$(13) & Chr$(13) & _
    40.              "Receiver at TMO: " & stReceiver & Chr$(13) & _
    41.              "Items belong to: " & stItems & Chr$(13) & _
    42.              "RAs Name: " & stRAname & Chr$(13) & _
    43.              "RAs Phone Number: " & stRAphone & Chr$(13) & Chr$(13) & _
    44.              "Tracking/Frieght Number: " & stTracking & Chr$(13) & _
    45.              "Contract/PO Number: " & stContract & Chr$(13) & _
    46.              "Vendors Name: " & stVendor & Chr$(13) & _
    47.              "Description of Items: " & stDescription & Chr$(13) & Chr$(13) & _
    48.              "This is an automated message. Please do not respond to this e-mail."
    49.  
    50.     'Write the e-mail content for sending to assignee
    51.     DoCmd.SendObject , , acFormatTXT, varTo, , , stSubject, stText, -1
    52.  
    53. Exit_Command53_Click:
    54.     Exit Sub
    55.  
    56. Err_Command53_Click:
    57.     MsgBox Err.Description
    58.     Resume Exit_Command53_Click
    59.  
    60. End Sub

  4. #4
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Re: Access Database Problems (need some programmers)

    Hi,

    I'm afraid your posts are confusing to me.

    Variants do not exist in VB.NET

    Referring to your first post:


    What is the Receiver
    ,, at TMO textbox.
    ,, RA

    Why are you having a problem displaying the User's name or ID? Presumable it is available in the LogIn form you are using. Are you asking how to make this information available in another form?

    What do you mean by "when a user selects Items belong to:" ???
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width