[AccessD] No Current Record when populating additem combo???

Bill Benson bensonforums at gmail.com
Sat Aug 1 14:30:24 CDT 2015


I don't follow. Collections are not 0 based as far as I know. Besides, that
would be a error code 1004 or something - this is a data error, relating to
no current record.

I think I have solved it, but I have to get home to check.  I think I have
relied on a default property and I should not have, since adding objects
(in this case a field) absorbs them whole.

I should have used

Col.add rst.fields (0).value, rst.fields (0).value

Instead of

Col.add rst.fields (0), rst.fields (0)

  none of you would have known that because I did not post all of my code I
am sorry
On Aug 1, 2015 1:31 PM, "Dan Waters" <df.waters at outlook.com> wrote:

> Hi Bill,
>
> Column.count is zero-based.
>
> Try   For i = 0 To col.Count - 1
>
> Hope that's it!
> Dan
>
>
> Sent from my Windows Phone
> ________________________________
> From: Bill Benson<mailto:bensonforums at gmail.com>
> Sent: ‎8/‎1/‎2015 10:28
> To: Access Developers discussion and problem solving<mailto:
> accessd at databaseadvisors.com>
> Subject: [AccessD] No Current Record when populating additem combo???
>
> I have a cbo whose rowsourcetype is value list.
> The problem is occurring on Form_Load, where I call a routine to populate
> the cbo.
> There is no controlsource, so this cbo is not tied to any field in the
> recordsource.
>
> I have stored some values that can go into the cbo (strings) in a
> collection.
>
> At the time I am having this problem there is only one item in the
> collection and the cbo is empty..
>
> My code is failing here:
>
> For i = 1 To col.Count
>     cboSessionUser.AddItem col(i)
> Next
>
> The error message is Runtime Error 3021 "No Current Record".
>
> This doesn't make any sense to me.
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list