Sabtu, 23 Desember 2017

RE: [MS_AccessPros] Re: Write all items in a list box to a table

 

Hi Art

Your loop control variable is i, while the index variable you are using is itm.  You should be using .ItemData(i)

This also suggests that you do not have Option Explicit in this module, which is the best way to introduce this kind of bug!

Best wishes,
Graham

 

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Sunday, 24 December 2017 12:59
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Re: Write all items in a list box to a table

 

 

 

OK Getting closer


For i = 0 To Me.lsteSubFolder.ListCount - 1

rstSubFolder.AddNew
rstSubFolder!SubLevelOneKey = Me.txtSubLevelOneKey
rstSubFolder!SubFolderName = Me.lsteSubFolder.ItemData(itm)
rstSubFolder!CAbinetID = Me.txtCabinetID
rstSubFolder!SL1NextLevel = "No"
rstSubFolder.Update

Next i


This almost works but not quite. If i put 3 items in the list box then its repeating the the first item in the listbox 3 times in the table, so instead of giving me APPLICANT, DATE, COMPANY it is writing APPLICANT,APPLICANT,APPLICANT in the table/

 

__._,_.___

Posted by: "Graham Mandeno" <graham@mandeno.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar