Hi Everyone...
Since posting my last message, I added a
Command Button (cmd_Store_Languages)to the subform which should transfer the items that are selected in the
MultiSelect Listbox to the
junction table. I think I've found the VBA code I need; however, I'm missing something & don't know what it is because when I try to execute it, I get an error message that says "
Object needed". Here's my coding (the Error portion of which was added by the Wizard when I set up the Command Button):
Option Compare Database
Private Sub cmd_Store_Languages_Click()
On Error GoTo Err_cmd_Store_Languages_Click
Dim sfrm As SubForm
Dim varItem As Variant
Dim SelectedVals
Set sfrm = SubForm![sfrm_Freelancer's_Languages]
For Each varItem In lsb_Languages.ItemsSelected
DoCmd.RunSQL "INSERT INTO[tbl_Freelancer's_Languages]([Language_ID#])"
Next varItem
Exit_cmd_Store_Languages_Click:
Exit Sub
Err_cmd_Store_Languages_Click:
MsgBox Err.Description
Resume Exit_cmd_Store_Languages_Click
End Sub____________________________________________________________
Private Sub Detail_Click()
End Sub____________________________________________________________
Private Sub Form_Load()
End Sub
The Wizard also had a line that read:
DoCmd.GoToRecord , , acNewRec
I replaced this line with the
DoCmd.RunSQL line. Do I possibly need them both?
I've come so far with this...I'd really like to get this one subform finished so that I can start over with one of the several others I have to do. I hate to go ahead & start on them, however, until I know for sure I'm doing it correctly. I located one seeminly simple solution to all of this posted by Mile O-Phile which simply placed everything in a "lookup fields" of the junction table. It was my same exact situation. I was just about to change mine to match his example when I happened to find an article entitled
"The Evils of Lookup Fields in Tables", which quickly changed my mind (
http://www.mvps.;org/access/lookupfields.htm). Figures that anything making life simplier would be BAD NEWS...lol.
Oh well, at least I'm learning a lot from this experience. I'm supposed to meet with my employer first thing Monday morning; so if anyone can possibly help me get this resolved before then, I would GREATLY appreciate it.
In your debt,
USEN