Results 1 to 10 of 10

Thread: I got frustrated. so any help plz !

  1. #1

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Angry I got frustrated. so any help plz !

    Hi Giant vb Coders

    Here is an attached file , I would appreciate that you download it coz it's color-enhanced so it will be easy job for you to solve this silly bug .

    Thanx a lot for your time and sleep well programmers
    Attached Files Attached Files
    Last edited by Pirate; Aug 29th, 2002 at 07:29 AM.

  2. #2

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Red face Re: I got frustrated. so any help plz !

    I can't see any1 here tried to solve this ****in peice of code .Did you get frustrated too , Didn't you ?
    I don't believe that !
    Hey Programmers you'd written the most complicated app and you don't have that tricky way to solve this !!

    this may give others courage to try

  3. #3
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    lol, I'm not here that often but let's see..

    ---

    Ok, I found this in the doc:

    VB Code:
    1. Public Function SaveToRec(Frm As Form, txtbox As TextBox, FieldName As String)
    2. Call clss.SaveToRec("Field_one", Form1, Text1.Text)

    As you can see the function SaveToRec wants a Form then a TextBox and a String as parameters.. you're giving it a String a Form and another String so this surely won't work. Try this:

    VB Code:
    1. Call clss.SaveToRec(Form1, Text1, "Field_one")

    Didn't try or read the rest, I have to do other things

  4. #4

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    thanx fox for this superfast reply ,lol

    anyway, I used

    Call clss.SaveToRec(Form1, Text1.Text, "Field_one")

    as you said , but I got error says:
    "type mismatch"
    Text1.Text

    C Ya

  5. #5
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    I said: Call clss.SaveToRec(Form1, Text1, "Field_one")

  6. #6

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    that's didn't work !!

    any other option plz fast .
    thanx Fox

  7. #7
    Addicted Member
    Join Date
    Aug 2002
    Location
    Baltimore, MD
    Posts
    230
    There's no reason to pass the form and textbox, just pass the text in the textbox:

    Public Function SaveToRec(sText As String, FieldName As String)

    and call it like this:

    Call clss.SaveToRec(Text1, "Field_one")

  8. #8
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    change this function:

    VB Code:
    1. Public Function SaveToRec(Frm As Form, txtbox As TextBox, FieldName As String)
    2. Rec.AddNew
    3. Rec.Fields(FieldName) = Frm.txtbox
    4. Rec.Update
    5. MsgBox "Finished writing to DB", vbOKOnly, "Done"
    6. End Function

    to:

    VB Code:
    1. Public Function SaveToRec(txtValue As String, FieldName As String)
    2. Rec.AddNew
    3. Rec.Fields(FieldName) = txtValue
    4. Rec.Update
    5. MsgBox "Finished writing to DB", vbOKOnly, "Done"
    6. End Function

    and then call the function like so:

    VB Code:
    1. Call SaveToRec (Text1, "Field_One")
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  9. #9
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    Originally posted by Machaira
    There's no reason to pass the form and textbox, just pass the text in the textbox:

    Public Function SaveToRec(sText As String, FieldName As String)

    and call it like this:

    Call clss.SaveToRec(Text1, "Field_one")
    Whoa! Thats exactly what i said, but i guess you posted it while i was typing my post
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  10. #10

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Done!!

    Thanx a lot Fox, MoMad , Machaira now vb world has just started with me, I can fire on .



    by the way this call never solve the problem :
    Call clss.SaveToRec(Form1, Text1, "Field_one")

    thanx again Giants

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