|
-
Aug 28th, 2002, 01:51 PM
#1
Thread Starter
Sleep mode
-
Aug 28th, 2002, 06:09 PM
#2
Thread Starter
Sleep mode
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
-
Aug 28th, 2002, 10:12 PM
#3
PowerPoster
lol, I'm not here that often but let's see..
---
Ok, I found this in the doc:
VB Code:
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:
VB Code:
Call clss.SaveToRec(Form1, Text1, "Field_one")
Didn't try or read the rest, I have to do other things
-
Aug 29th, 2002, 07:25 AM
#4
Thread Starter
Sleep mode
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
-
Aug 29th, 2002, 01:16 PM
#5
PowerPoster
I said: Call clss.SaveToRec(Form1, Text1, "Field_one")
-
Aug 29th, 2002, 02:59 PM
#6
Thread Starter
Sleep mode
that's didn't work !!
any other option plz fast .
thanx Fox
-
Aug 29th, 2002, 05:43 PM
#7
Addicted Member
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")
-
Aug 29th, 2002, 05:44 PM
#8
Fanatic Member
change this function:
VB Code:
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:
VB Code:
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:
VB Code:
Call SaveToRec (Text1, "Field_One")
-
Aug 29th, 2002, 05:45 PM
#9
Fanatic Member
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
-
Aug 30th, 2002, 04:02 PM
#10
Thread Starter
Sleep mode
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|