Re: orders form... using DMAX to assign new order number
- From: "Dan Artuso" <dartuso@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 6 Apr 2005 09:17:43 -0400
Hi,
>From the info in your post, I would say to put the code in the cboordertype AfterUpdate event.
No, it should definitely not be an autonumber.
I can only guess at how you want it to work, so, post more info.
Did the code fail? If so, what line?
I'm also assuming that each ordertype is treated seperately as far as order numbers go.
Is that correct?
The code I gave you places the new number in a variable, you have to do something with that.
--
HTH
-------
Dan Artuso, MVP
"Brook" <Brook@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:BB906C61-005E-4AFF-93B6-A7170A39E4C3@xxxxxxxxxxxxxxxx
> hello... I have tried your suggested code, but was unable to get it to work
> the way that I would like..
>
> Should my ordernumber in my tblorders be an "Autonumber"?
>
> Do I need to add the code to the afterupdate?
>
> Thanks,
>
> Brook
>
> "Brook" wrote:
>
> > Thank you very much Dan,
> >
> > I am going to try this and see how it goes... I will post a response one
> > way or another.
> >
> > Brook
> >
> > "Dan Artuso" wrote:
> >
> > > Hi,
> > > Something like this maybe?
> > >
> > > dim lngOrderNumber as Long
> > >
> > > lngOrderNumber = DMax("[ordernumber]", "tblorders", "ordertype = '" & Me.cboordertype & "'") + 1
> > >
> > > --
> > > HTH
> > > -------
> > > Dan Artuso, MVP
> > >
> > >
> > > "Brook" <Brook@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:23DB32DB-EF5B-412E-86F2-5C3F5231879A@xxxxxxxxxxxxxxxx
> > > > Good Day,
> > > >
> > > > I have have a form (frmneworders) that is based on my tblorders. The fields
> > > > are ordernumber, ordertype(based on cboordertype) for Custom, Program, or
> > > > Sample, and orderdetails.
> > > >
> > > > What I want to set up is this: When the user selects a new order, they will
> > > > choose the ordertype form the cboordertype, and after that ordertype is
> > > > selected I need to know how to create the code to lookup the DMAX for the
> > > > ordernumber and add 1 too it, to create a sequential ordering system for each
> > > > type of order.
> > > >
> > > > If anyone has any ideas... tips please pass them along...
> > > >
> > > > Thanks in advance..
> > > >
> > > > Brook
> > >
> > >
> > >
.
- Follow-Ups:
- References:
- orders form... using DMAX to assign new order number
- From: Brook
- Re: orders form... using DMAX to assign new order number
- From: Dan Artuso
- Re: orders form... using DMAX to assign new order number
- From: Brook
- Re: orders form... using DMAX to assign new order number
- From: Brook
- orders form... using DMAX to assign new order number
- Prev by Date: Re: Undo doesn't reset unbound controls
- Next by Date: Navigation for single form view
- Previous by thread: Re: orders form... using DMAX to assign new order number
- Next by thread: Re: orders form... using DMAX to assign new order number
- Index(es):
Relevant Pages
|