|
-
Aug 29th, 2000, 01:51 PM
#1
Thread Starter
_______
<?>
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
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 29th, 2000, 02:02 PM
#2
New Member
HeSaidJoe,
I have checked the properties for my data control it's called data1.
Thanks
Tahir
Visual Basic 6.0 Enterprise Edition
saqi_the_angel
-
Aug 29th, 2000, 02:43 PM
#3
Thread Starter
_______
<?>
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.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 29th, 2000, 03:14 PM
#4
Thread Starter
_______
<?> ..this is as good as it gets..
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]
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 30th, 2000, 11:51 AM
#5
New Member
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
Visual Basic 6.0 Enterprise Edition
saqi_the_angel
-
Aug 30th, 2000, 11:56 AM
#6
Thread Starter
_______
<?>
try = Cint(text4.text)
or Val(text4.text)
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 30th, 2000, 12:08 PM
#7
Thread Starter
_______
<?>
sorry...that should be CLng(text4.text)
trying to do too many things at once here.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
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
|