Results 1 to 8 of 8

Thread: can i do this without text boxes

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Location
    Plymouth UK
    Posts
    65

    Question can i do this without text boxes

    ok this bit of code reads textbox and updates the database but can i do it with out the text boxes using the fields from database in stead
    not sure if this should be here or in database section
    cheers
    Doug
    Code:
    Private Sub Form_Load()
    With Adodc1.Recordset
        Do Until Adodc1.Recordset.EOF
          If Adodc1.Recordset!currant = "Yes" Then
            txtTotal.Text = Format(Val(txtQuantity.Text) - (Date - CDate(txtFill.Text)) * Val(txtDose.Text), "00")
            .Update
          End If
          .MoveNext
        Loop
        .MoveLast
    End With
    End Sub
    and old man trying to keep up

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: can i do this without text boxes

    Where would the values come from (the ones that are now in txtQuantity and txtFill and txtDose)?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Location
    Plymouth UK
    Posts
    65

    Re: can i do this without text boxes

    they are in database fields quantity, dosage, fill date
    cheers
    just trying to make my prog simpler to use
    Doug
    and old man trying to keep up

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: can i do this without text boxes

    And what field is being updated with this?

    Are you familiar with writing SQL queries? (In this case, an UPDATE query)

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Location
    Plymouth UK
    Posts
    65

    Re: can i do this without text boxes

    field total in this instance
    have not got any clue with sql
    sorry
    cheers
    Doug
    and old man trying to keep up

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Location
    Plymouth UK
    Posts
    65

    Re: can i do this without text boxes

    this is how it looks at the moment
    you fill in name quantity fill date and dosage then every thing else should update its self
    if you see what i mean
    cheers
    Doug
    Attached Images Attached Images  
    and old man trying to keep up

  7. #7
    Hyperactive Member
    Join Date
    Aug 2007
    Posts
    269

    Re: can i do this without text boxes

    It's current not currant

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Location
    Plymouth UK
    Posts
    65

    Re: can i do this without text boxes

    just a small mistake
    hehehe
    Doug
    and old man trying to keep up

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