[AccessD] Setting Combobox to Last Item

Mark A Matte markamatte at hotmail.com
Tue Aug 14 10:44:12 CDT 2007


I would check to see what value intFinModelCount is returning, or what 
type...integer or text?...because  (assuming we're talking about 1 form)...
Me!cboFinModelDate = Me!cboFinModelDate.ItemData(intFinModelCount)

should work.

Good Luck,

Mark A. Matte




>From: David Emerson <newsgrps at dalyn.co.nz>
>Reply-To: Access Developers discussion and problem 
>solving<accessd at databaseadvisors.com>
>To: accessd at databaseadvisors.com
>Subject: [AccessD] Setting Combobox to Last Item
>Date: Tue, 14 Aug 2007 14:38:36 +1200
>
>I want to open a form and set a combo box to the last item in the
>list (the list is based on a table so the last item isn't static).
>
>On the Form open event I have:
>
>      intFinModelCount = (basRunDataObject("SELECT FinModelID FROM
>dbo.tblFinModel", adCmdText).RecordCount) - 1
>      If intFinModelCount > 0 Then
>          Me!cboFinModelDate =
>[Forms]![frmFinModel]![cboFinModelDate].[ItemData](intFinModelCount)
>'Error here
>      End If
>
>The error I get is 450 - Wrong number of arguments or invalid
>property assignment.
>
>Any pointers on where I might be wrong?
>
>Regards
>
>David Emerson
>Dalyn Software Ltd
>Wellington, New Zealand
>
>--
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com

_________________________________________________________________
Booking a flight? Know when to buy with airfare predictions on MSN Travel. 
http://travel.msn.com/Articles/aboutfarecast.aspx&ocid=T001MSN25A07001




More information about the AccessD mailing list