From: KSmith on
Ok, I will try that.

And again, many thanks!
--
KSmith


"mie via AccessMonster.com" wrote:

> 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
>
> .
>
From: Dirk Goldgar on
"KSmith" <KSmith(a)discussions.microsoft.com> wrote in message
news:3A43B827-F243-41DC-B63D-3F077AB267F4(a)microsoft.com...
> 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)

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

> "KSmith" <KSmith(a)discussions.microsoft.com> wrote in message
> news:3A43B827-F243-41DC-B63D-3F077AB267F4(a)microsoft.com...
> > 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)
>
From: KSmith on
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" wrote:

> 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" wrote:
>
> > "KSmith" <KSmith(a)discussions.microsoft.com> wrote in message
> > news:3A43B827-F243-41DC-B63D-3F077AB267F4(a)microsoft.com...
> > > 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)
> >
From: Dirk Goldgar on
"KSmith" <KSmith(a)discussions.microsoft.com> wrote in message
news:4A6EFFB8-B37C-49A7-A5C6-12C969E20188(a)microsoft.com...
> 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" wrote:
>
>> "KSmith" <KSmith(a)discussions.microsoft.com> wrote in message
>> news:3A43B827-F243-41DC-B63D-3F077AB267F4(a)microsoft.com...
>> >
>> > 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)