subform.field1.value = mainform.field1 ?
subform.field1.value = mainform.field1 ?
am 05.11.2007 15:19:49 von magmike
What is the correct way to code this?
I'd like to change the value of a field on the main form with the
value of a field on the subform using the click event of a command
button. I currently have the button on the subform.
I am also trying to use a WHERE statement for an unbound check box, so
that it will only copy over the value to the main form if the check
box is clicked.
I am also trying to do this for about 12 fields between both forms and
am hoping to do it all with one click of one button.
I've have been trying to figure this out, but can't seem to get it
right. I'm not surprised - i'm not very good at this yet. Thanks alot
for you help in advance!
mike
Re: subform.field1.value = mainform.field1 ?
am 05.11.2007 18:21:22 von Rich P
Hi Mike,
In the subform command button all you need to do is something like this:
Private Sub Command2_Click() '--code in subsform
If Check3 = -1 Then
Forms!formMain!Text2 = "testabc"
End If
End Sub
The checkbox can have a value of 0 (not checked) and -1 (yes checked).
Rich
*** Sent via Developersdex http://www.developersdex.com ***
Re: subform.field1.value = mainform.field1 ?
am 05.11.2007 23:13:33 von none
"magmike" wrote in message
news:1194272389.665931.83070@57g2000hsv.googlegroups.com...
> What is the correct way to code this?
>
> I'd like to change the value of a field on the main form with the
> value of a field on the subform using the click event of a command
> button. I currently have the button on the subform.
>
> I am also trying to use a WHERE statement for an unbound check box, so
> that it will only copy over the value to the main form if the check
> box is clicked.
>
> I am also trying to do this for about 12 fields between both forms and
> am hoping to do it all with one click of one button.
>
> I've have been trying to figure this out, but can't seem to get it
> right. I'm not surprised - i'm not very good at this yet. Thanks alot
> for you help in advance!
>
> mike
>
Lookup Parent property.
If the parent form has the control OrderID, then a sub form could use
Parent!OrderID to reference it.
Re: subform.field1.value = mainform.field1 ?
am 06.11.2007 01:33:35 von magmike
On Nov 5, 11:21 am, Rich P wrote:
> Hi Mike,
>
> In the subform command button all you need to do is something like this:
>
> Private Sub Command2_Click() '--code in subsform
> If Check3 = -1 Then
> Forms!formMain!Text2 = "testabc"
> End If
> End Sub
>
> The checkbox can have a value of 0 (not checked) and -1 (yes checked).
>
> Rich
>
> *** Sent via Developersdexhttp://www.developersdex.com***
How would I insert the value of a subform field? Is this correct?
Forms!formMain!Text2 = [Field2]
Re: subform.field1.value = mainform.field1 ?
am 06.11.2007 16:59:37 von magmike
On Nov 5, 11:21 am, Rich P wrote:
> Hi Mike,
>
> In the subform command button all you need to do is something like this:
>
> Private Sub Command2_Click() '--code in subsform
> If Check3 = -1 Then
> Forms!formMain!Text2 = "testabc"
> End If
> End Sub
>
> The checkbox can have a value of 0 (not checked) and -1 (yes checked).
>
> Rich
>
> *** Sent via Developersdexhttp://www.developersdex.com***
How would I do multiple versions of this in one button click, to
transfer data between 12 fields?