What is the name of your data control cause that is what the line is all about..it's saying get ready for a new entry. I think it means you don't have a datacontrol called data1.
Wayne
Printable View
What is the name of your data control cause that is what the line is all about..it's saying get ready for a new entry. I think it means you don't have a datacontrol called data1.
Wayne
HeSaidJoe,
I have checked the properties for my data control it's called data1.
Thanks
Tahir
Give me 10 0r 20...I'll post a bit of code here and you can
do the adjusting ot suit your project. Make sure your data1 control is pointing to the correct MDB and that the recordsource is set.
Code:Option Explicit
Public cDBName As String
Public cTblName As String
Public Sub OpenDB()
Dim db As Database, rs As Recordset
Dim AppPath$
If Right(App.Path, 1) <> "\" Then _
AppPath = App.Path & "\" _
Else AppPath = App.Path
cDBName = AppPath & "YourDatabaseName.mdb"
cTblName = "YourTable"
Set db = Workspaces(0).OpenDatabase(cDBName)
Set rs = db.OpenRecordset(cTblName)
Data1.DatabaseName = cDBName
Data1.RecordSource = cTblName
Data1.Refresh
End Sub
Private Sub Command1_Click()
Data1.Recordset.AddNew
Data1.Recordset!YourField = Text1.Text
Data1.Recordset.Update
Data1.Refresh
Command1.Enabled = False
End Sub
Private Sub Form_Activate()
'
Call OpenDB
'
Form1.Data1.Recordset.movefirst
'I edited this line
'this line I use to test reading your file (not needed)
'Text1.Text = Data1.Recordset!YourField
End Sub
[Edited by HeSaidJoe on 08-29-2000 at 05:15 PM]
HeSaidJoe,
I think we are getting there. Now I have got problem with integer field
Data1.Recordset!pubid = Text4.Text
pubid is long integer what should i use it instead of test.
I get run time error.
Data type conversion error
What should I use use instead of text.
Thanks
Tahir
try = Cint(text4.text)
or Val(text4.text)
sorry...that should be CLng(text4.text)
trying to do too many things at once here.