Combo Box

Makaveli

Access SMP
Local time
Today, 18:51
Joined
Jul 1, 2008
Messages
17
To link up my forms i used the following two pieces of code

Inside of the form opening
Private Sub Form_beforeUpdate(Cancel As Integer)
Me.[Property ID] = Forms![property]![Property ID]
End Sub

Inside of the button that opens the form
DoCmd.OpenForm "My Form", acNormal, , [Property ID] = " & me"


Theres no problem with the code it works fine, its just that....since i've used it, my combo boxes dont work, I've even tried to refresh them.

These are the options i select from the wizard

Look up the values in a table or query
I select my table "affiliate"
I choose name and post code
I sort via name
I leave it to hide the key column
I select store that value in this field and select "affil ID"

Theres also an "affil" ID in my properties table, its the unique key and an autonumber in the affil table, but just an ordinary number field in the properties table.

When i select the affiliate, it should automaticaly populate the propertys tables affiliate id so that the affiliate details are linked to that property.

As i said... used to work...not anymore.. (i blame microsoft shhhhh)..I have the worst luck with Access....please help
 
just reading quickly, did you type this properly?: DoCmd.OpenForm "My Form", acNormal, , [Property ID] = " & me"
shouldn't it be
..."[Property ID] = " & me.propertyid
not sure if that'll help your issue though.
 
Thanks for your reply,

I did type it correctly, i'm not to good with VBA. Your way seems to make alot more sense, probaly a little stabler too. I've made the changes, thank you. it still hasn't solved my problem though :-(
 

Users who are viewing this thread

Back
Top Bottom