Connecting Tech Pros Worldwide Forums | Help | Site Map

Changing field value in subform

Dee
Guest
 
Posts: n/a
#1: Nov 12 '05
I'm trying to change a field value on a subform called Inventory
whenever a field on the main form is updated. I can't get it to work.
Could someone correct my line of code?


Private Sub Ctl5inBoxKDeliv_rd_AfterUpdate()

Me!Inventory.Form.K5inBoxK = 99

End Sub

Trevor Best
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Changing field value in subform


On 19 Nov 2003 23:24:10 -0800 in comp.databases.ms-access,
wolfesimon@comcast.net (Dee) wrote:
[color=blue]
>I'm trying to change a field value on a subform called Inventory
>whenever a field on the main form is updated. I can't get it to work.
>Could someone correct my line of code?
>
>
>Private Sub Ctl5inBoxKDeliv_rd_AfterUpdate()
>
>Me!Inventory.Form.K5inBoxK = 99
>
>End Sub[/color]

Me!Inventory.Form!K5inBoxK = 99

--
A)bort, R)etry, I)nfluence with large hammer.
Dee Simon
Guest
 
Posts: n/a
#3: Nov 12 '05

re: Changing field value in subform




Me!Inventory.Form!K5inBoxK = 99

does not work either

"Microsoft Access can't find the field 'Inventory' referred to in your
expression."



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Allen Browne
Guest
 
Posts: n/a
#4: Nov 12 '05

re: Changing field value in subform


Dee, it is possible that the subform control does not have the same name as
the form it contains (its SourceObject).

Open your main form in Design view.
Right-click the edge of the subform control, and choose Properties.
Look at the Name property ("Other" tab) of the subform control.

If' it's called "My Inventory" or something, try:
Me![My Inventory].Form![K5inBoxK] = 99

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Dee Simon" <wolfesimon@comcast.net> wrote in message
news:3fbc8511$0$194$75868355@news.frii.net...[color=blue]
>
>
> Me!Inventory.Form!K5inBoxK = 99
>
> does not work either
>
> "Microsoft Access can't find the field 'Inventory' referred to in your
> expression."[/color]


Dee Simon
Guest
 
Posts: n/a
#5: Nov 12 '05

re: Changing field value in subform


Thanks Allen

That was it. Should have known this myself. Had a senior moment her
after 36 hrs of no sleep.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Trevor Best
Guest
 
Posts: n/a
#6: Nov 12 '05

re: Changing field value in subform


On 20 Nov 2003 13:50:39 GMT in comp.databases.ms-access, Dee Simon
<wolfesimon@comcast.net> wrote:
[color=blue]
>Thanks Allen
>
>That was it. Should have known this myself. Had a senior moment her
>after 36 hrs of no sleep.[/color]

Nah, sleep is for wusses :-)

--
A)bort, R)etry, I)nfluence with large hammer.
Closed Thread