[mso] Re: Access 2002: DMax Problem

  • From: Cathy.Evans@xxxxxxxxx
  • To: mso@xxxxxxxxxxxxx
  • Date: Tue, 30 Aug 2005 11:35:46 -0400

Thanks, Jim.  Neither worked, still got same results, so I went back to my
combo box thinking I didn't have it set up right thereby messing up the
query.  So I reworked that, then reworked my query so the typeid would be
based on the form typeid value based on the after update event of the
combo.

Still getting same results, the typeid that has the number value of 3000
returns 5001.  Below is my latest rework.  I only have 2 values in my
MasterTypeID table, and my intent is to update the number value by 1 based
on the TypeID selected in the form.
Seems I've done this before but don't know why it's not picking up the
right number against selected ID.

Anyway, thanks, Cathy

SELECT MasterTypeID.TypeID, MasterTypeID.TypeDesc, MasterTypeID.Number,
(DMax("[Number]","MasterTypeID")+1) AS NextNumber
FROM MasterTypeID
WHERE (((MasterTypeID.TypeID)=[forms]![selectordertype]![typeid]));



                                                                                
                                
                      "Jim Pettit"                                              
                                
                      <jimpettit@xxxxxxxx      To: <mso@xxxxxxxxxxxxx>          
                                
                      m>                                                        
                                
                      Sent by:                 cc:                              
                                
                      mso-bounce@freelist                                       
                                
                      s.org                    Subject:  [mso] Re: Access 2002: 
DMax Problem                    
                      08/30/2005 10:58 AM                                       
                                
                      Please respond to                                         
                          ..... 
                      mso                                                       
                                
                                                                                
                                
                                                                                
                                




Cathy--

With the form objects in quotation marks like that, Access can't "see" the
value you want it to see; it's trying to find a record that matches the
name
of the box. ;-)

Try this instead:

SELECT TypeID, Type, Number,
DMax("Number", "MasterTypeID", Forms!Selectordertype!Cbotype) + 1 AS
NextNumber
FROM MasterTypeID

That'll work if the bound column for your combo box is the one you want, if
not, you'll have to go with this:

SELECT TypeID, Type, Number,
DMax("Number", "MasterTypeID", Forms!Selectordertype!Cbotype.Columns(?)) +
1
AS NextNumber
FROM MasterTypeID

--Jim





-----------------------------------------------------------------------------------------------------
The information transmitted is intended only for the person
or entity to which it is addressed and may contain proprietary,  
business-confidential and/or privileged material.
If you are not the intended recipient of this message you 
are hereby notified that any use, review, retransmission, 
dissemination, distribution, reproduction or any action taken
in reliance upon this message is prohibited. If you received
this in error, please contact the sender and delete the 
material from any computer.  Any views expressed in this message
are those of the individual sender and may not necessarily reflect 
the views of the company.  
-------------------------------------------------------------------------------------------------------

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: