Click to See Complete Forum and Search --> : I got frustrated. so any help plz !
Pirate
Aug 28th, 2002, 01:51 PM
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 ;)
Pirate
Aug 28th, 2002, 06:09 PM
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 ;)
Fox
Aug 28th, 2002, 10:12 PM
lol, I'm not here that often but let's see..
---
Ok, I found this in the doc:
Public Function SaveToRec(Frm As Form, txtbox As TextBox, FieldName As String)
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:
Call clss.SaveToRec(Form1, Text1, "Field_one")
Didn't try or read the rest, I have to do other things :p
Pirate
Aug 29th, 2002, 07:25 AM
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
Fox
Aug 29th, 2002, 01:16 PM
I said: Call clss.SaveToRec(Form1, Text1, "Field_one")
Pirate
Aug 29th, 2002, 02:59 PM
that's didn't work !!
any other option plz fast .
thanx Fox
Machaira
Aug 29th, 2002, 05:43 PM
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")
MoMad
Aug 29th, 2002, 05:44 PM
change this function:
Public Function SaveToRec(Frm As Form, txtbox As TextBox, FieldName As String)
Rec.AddNew
Rec.Fields(FieldName) = Frm.txtbox
Rec.Update
MsgBox "Finished writing to DB", vbOKOnly, "Done"
End Function
to:
Public Function SaveToRec(txtValue As String, FieldName As String)
Rec.AddNew
Rec.Fields(FieldName) = txtValue
Rec.Update
MsgBox "Finished writing to DB", vbOKOnly, "Done"
End Function
and then call the function like so:
Call SaveToRec (Text1, "Field_One")
MoMad
Aug 29th, 2002, 05:45 PM
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 :)
Pirate
Aug 30th, 2002, 04:02 PM
Thanx a lot Fox, MoMad , Machaira now vb world has just started with me, I can fire on .
:D
by the way this call never solve the problem :
Call clss.SaveToRec(Form1, Text1, "Field_one")
thanx again Giants:eek:
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.