From: KSmith on
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

--
KSmith
From: mie via AccessMonster.com on
Try this,

Dim rs As DAO.Recordset

Set rs = Me.RecordsetClone

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

If Not rs.NoMatch Then Me.Bookmark = rs.Bookmark

set rs = Nothing

KSmith wrote:
>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
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201005/1

From: mie via AccessMonster.com on
>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)

KSmith wrote:
>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
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201005/1

From: KSmith on
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" wrote:

> >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)
>
> KSmith wrote:
> >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
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201005/1
>
> .
>
From: mie via AccessMonster.com on
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.

KSmith wrote:
>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]
>> >
>> >Thanks

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201005/1