Microsoft
Software
Hardware
Network
Question : Insert from listbox changes text to number
I have 2 listboxes. One has a listing of 4 digit numbers (text - they have leading zeros) from a table. The other list box shows the value I chose from the first text box. It queries a table where the data is stored as text. When I run my procedure the data ends up in the second list box without the leading zero(s). ie 0875 becomes 875. The data shows properly in the first listbox.
Here is the code:
Dim strSQL As String
strSQL = "INSERT INTO tbl_lstSelectedChapter(Sel
ectedChapt
er) VALUES (" & Me.lstAllChapters & ")"
CurrentDb.Execute strSQL, dbFailOnError
Answer : Insert from listbox changes text to number
Try this:
strSQL = "INSERT INTO tbl_lstSelectedChapter(Sel
ectedChapt
er) VALUES (" & Format(Me.lstAllChapters, "0000") & ")"
Random Solutions
Gmail Expert Needed. . ."Display images below"
ASA5505 vpn clients can't talk to inside hosts
Disable Delete
Cannot get Windows to operate on multiple files with right click context menu.
Stalling problem with Outlook 2003 and ACT
cron job to automatically replicate remote mysql server database with local mysql running under mac os x (MAMP)
Clipboard problems + WinXP
different between use POP3 , IMP4 and http
Remove Exchange 2007 - Clustered Mail Box Servers
excel transpose autofill question