RunTime Error 3070

K

KSmith

Thanks in advance
I'm an old dBase Command Line Programmer and Access 2007 is kinda of
confusing at times.

I'm writing an Access 2007 Inventory Control Program.
Made one form to subtract inventory from one table and add inventory to
another table. This works find. Copied the form, got the tables ready and
when I run the following code (that works in the 1st form) I get a RunTime
Error 3070.

Private Sub cboMaterialLookUp_AfterUpdate()
' This section finds the record number in tblRouterArea that matches
the record Number of the
' selection in the combo box
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[RouterID_tblRouterArea] = " &
Str(Nz(Me![cboMaterialLookUp], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

End Sub

Thanks
 
K

KSmith

Thanks for the reply. I copied your code to mine and ran it, with almost the
same results. I got Error 3345 this time.

Thanks for the help.
--
KSmith


mie via AccessMonster.com said:
Str(Nz(Me![cboMaterialLookUp], 0))
--Do you need to use 'Str' Function? What data type your Combo Box return? (i
guess it Combo Box judging from the name)
Thanks in advance
I'm an old dBase Command Line Programmer and Access 2007 is kinda of
confusing at times.

I'm writing an Access 2007 Inventory Control Program.
Made one form to subtract inventory from one table and add inventory to
another table. This works find. Copied the form, got the tables ready and
when I run the following code (that works in the 1st form) I get a RunTime
Error 3070.

Private Sub cboMaterialLookUp_AfterUpdate()
' This section finds the record number in tblRouterArea that matches
the record Number of the
' selection in the combo box
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[RouterID_tblRouterArea] = " &
Str(Nz(Me![cboMaterialLookUp], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

End Sub

Thanks

--
Message posted via AccessMonster.com


.
 
K

KSmith

Ok, I will try that.

And again, many thanks!
--
KSmith


mie via AccessMonster.com said:
i play around with the code, but never get Error 3345. May be it related to
something else.Try removes all control source, record source, row source and
resetting again.
Thanks for the reply. I copied your code to mine and ran it, with almost the
same results. I got Error 3345 this time.

Thanks for the help.
Str(Nz(Me![cboMaterialLookUp], 0))
--Do you need to use 'Str' Function? What data type your Combo Box return? (i
[quoted text clipped - 24 lines]

--
Message posted via AccessMonster.com


.
 
D

Dirk Goldgar

KSmith said:
Thanks in advance
I'm an old dBase Command Line Programmer and Access 2007 is kinda of
confusing at times.

I'm writing an Access 2007 Inventory Control Program.
Made one form to subtract inventory from one table and add inventory to
another table. This works find. Copied the form, got the tables ready
and
when I run the following code (that works in the 1st form) I get a RunTime
Error 3070.

Private Sub cboMaterialLookUp_AfterUpdate()
' This section finds the record number in tblRouterArea that
matches
the record Number of the
' selection in the combo box
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[RouterID_tblRouterArea] = " &
Str(Nz(Me![cboMaterialLookUp], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

End Sub


In addition to the code changes suggested by mie, verify that the form's
recordsource actually contains a field named "RouterID_tblRouterArea". I'm
guessing that it doesn't.
 
K

KSmith

RouterID is the first field in tblRouterArea TABLE
RouterID is the first field in the Forms Record Source: Select Statement
RouterID is the first field in the ComboBox Row Source: Select Statement
Bound Column is set to 1

--
KSmith


Dirk Goldgar said:
KSmith said:
Thanks in advance
I'm an old dBase Command Line Programmer and Access 2007 is kinda of
confusing at times.

I'm writing an Access 2007 Inventory Control Program.
Made one form to subtract inventory from one table and add inventory to
another table. This works find. Copied the form, got the tables ready
and
when I run the following code (that works in the 1st form) I get a RunTime
Error 3070.

Private Sub cboMaterialLookUp_AfterUpdate()
' This section finds the record number in tblRouterArea that
matches
the record Number of the
' selection in the combo box
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[RouterID_tblRouterArea] = " &
Str(Nz(Me![cboMaterialLookUp], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

End Sub


In addition to the code changes suggested by mie, verify that the form's
recordsource actually contains a field named "RouterID_tblRouterArea". I'm
guessing that it doesn't.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
 
K

KSmith

I solved the problem, kinda. I removed some of the spaces that were in the
middle of the FindFirst line of code, and it Ran like it should.

Now the spaces are in the code that I copied from. I am new at this and I
don't have all of my procedures in a module, they are attached to the forms.

Wonder why the spaces are a problem in one place but not in another?


Thanks for all of the help.
--
KSmith


KSmith said:
RouterID is the first field in tblRouterArea TABLE
RouterID is the first field in the Forms Record Source: Select Statement
RouterID is the first field in the ComboBox Row Source: Select Statement
Bound Column is set to 1

--
KSmith


Dirk Goldgar said:
KSmith said:
Thanks in advance
I'm an old dBase Command Line Programmer and Access 2007 is kinda of
confusing at times.

I'm writing an Access 2007 Inventory Control Program.
Made one form to subtract inventory from one table and add inventory to
another table. This works find. Copied the form, got the tables ready
and
when I run the following code (that works in the 1st form) I get a RunTime
Error 3070.

Private Sub cboMaterialLookUp_AfterUpdate()
' This section finds the record number in tblRouterArea that
matches
the record Number of the
' selection in the combo box
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[RouterID_tblRouterArea] = " &
Str(Nz(Me![cboMaterialLookUp], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

End Sub


In addition to the code changes suggested by mie, verify that the form's
recordsource actually contains a field named "RouterID_tblRouterArea". I'm
guessing that it doesn't.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
 
D

Dirk Goldgar

KSmith said:
RouterID is the first field in tblRouterArea TABLE
RouterID is the first field in the Forms Record Source: Select Statement
RouterID is the first field in the ComboBox Row Source: Select Statement
Bound Column is set to 1

Dirk Goldgar said:
KSmith said:
Set rs = Me.Recordset.Clone
rs.FindFirst "[RouterID_tblRouterArea] = " &
Str(Nz(Me![cboMaterialLookUp], 0))

In addition to the code changes suggested by mie, verify that the form's
recordsource actually contains a field named "RouterID_tblRouterArea".
I'm
guessing that it doesn't.


If "RouterID" is the name of the field, then why are you looking for
"[RouterID_tblRouterArea]"? Your .FindFirst statement ought to be just:

rs.FindFirst "RouterID = " & Nz(Me![cboMaterialLookUp], 0)

If that doesn't work, then either RouterID is not a numeric field (which you
have implied that it is), or you have misinformed us about something, and
will need to post the exact SQL of the form's RecordSouce to help us figure
it out.
 
D

Dirk Goldgar

KSmith said:
I solved the problem, kinda. I removed some of the spaces that were in the
middle of the FindFirst line of code, and it Ran like it should.

What spaces are you talking about? I don't see any superfluous spaces in
what you posted here. Please post the revised statement that seems to work.
 
K

KSmith

Thanks for responding to my problem. Sorry for the long delay in getting
back, I had a death in the family.

The "spaces" were not the problem, as you said. To solve this problem I
looked back over my notes and found that I created the first form as a
columnar form with the widzard. I made a new columnar form with the same
tables as my problem form. I then copied the Record Source line from the
newly made form to the Record Source line in the problem second form.

This corrected the problem I was having. But I still don't understand why
that corrected the problem.

I have another problem that I will post.

And thank you for all of your help.

--
KSmith


Dirk Goldgar said:
KSmith said:
RouterID is the first field in tblRouterArea TABLE
RouterID is the first field in the Forms Record Source: Select Statement
RouterID is the first field in the ComboBox Row Source: Select Statement
Bound Column is set to 1

Dirk Goldgar said:
Set rs = Me.Recordset.Clone
rs.FindFirst "[RouterID_tblRouterArea] = " &
Str(Nz(Me![cboMaterialLookUp], 0))

In addition to the code changes suggested by mie, verify that the form's
recordsource actually contains a field named "RouterID_tblRouterArea".
I'm
guessing that it doesn't.


If "RouterID" is the name of the field, then why are you looking for
"[RouterID_tblRouterArea]"? Your .FindFirst statement ought to be just:

rs.FindFirst "RouterID = " & Nz(Me![cboMaterialLookUp], 0)

If that doesn't work, then either RouterID is not a numeric field (which you
have implied that it is), or you have misinformed us about something, and
will need to post the exact SQL of the form's RecordSouce to help us figure
it out.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Problem with Combo Box FindNext 7
Textbox Filter 4
runtime error 13 2
Error 2237 8
Runtime Error 3070 7
access runtime error 3314 Me.Bookmark = rs.Bookmark 0
Error 2147352567 2
Combo Box Error 3077 - Access 2003 1

Top