ASAP?? Set control source of unbound control

C

Christine

Hope someone can help me with this little problem, quickly
if possible!

Could someone advise how to set the control source for an
unbound control on a form from another form?

For example, if the user clicks CmdDescription in FormA,
FormB will display the Description for that record. In the
same FormA, if they click CmdSolution, FormB will display
the Solution field, etc.

In essence, what I'm doing is trying to replicate the
Access Zoombox command. (Can't use the built-in Access
Zoombox feature in this instance.)

Here's what I've got thus far in Form A. The unbound
control in FormB that I want to set the Data Control
Source for is named "VaryRecSource". The same table is
used in each form. The field in FormA can be edited, as
well as the field in FormB.

DoCmd.RunCommand acCmdSaveRecord
Dim stDocName As String
Dim stLinkCriteria As String
Dim VaryField As String
stDocName = "FormB"
VaryField = "Description"
stLinkCriteria = "[CARNum]=" & Me![CARNum]
DoCmd.OpenForm stDocName, , , stLinkCriteria

In FormB, the name of the control is "ThisField" and the
control source is =[VaryField]. (Public VaryField is
declared.) The problem appears to be getting the current
value of VaryField from the table, since FormB will be
called from a variety of forms other than FormA.

Any help ASAP will be greatly appreciated.

Christine
 
M

MacDermott

I think that your approach may not be especially productive.
Trying to edit the same (bound) data in two different forms sounds like a
recipe for disaster to me.

If you really must use this sort of approach, I'd suggest an unbound textbox
where you can (programmatically) copy data back and forth.

However, perhaps you could say a bit more about why Zoombox won't work?
There may be work-arounds for your problems.

Also - here's another thought:
you might be able to put your editing box on a separate page of a tab
control on the same form.

HTH
- Turtle
 
S

Set control source of unbound control

Hi, Turtle. The reason I don't want to use the ZoomBox is
because, eventually, I'd like to use Stephen Leban's RTF
tools for formatting the text of my memo fields (which all
of these fields will be). The ZoomBox contains buttons for
formatting the text, which wouldn't be good when I
incorporate the RTF controls. The reason for opening the
other form (FormB) is because the text of these memo
fields could be quite lengthly, and I wanted to be able to
allow the users to see as much of the field as possible. I
thought about tab controls, but I've already got a bunch
of them and didn't want to complicate form naviation and
information display any more than I already have.

You mentioned copying data back and forth...hum... in
FoxPro I could see this happening quite easily, but how
would that work in Access (I have never had to use a copy
command in Access before).

Your help and suggestions are appreciated!
Christine
-----Original Message-----
I think that your approach may not be especially productive.
Trying to edit the same (bound) data in two different forms sounds like a
recipe for disaster to me.

If you really must use this sort of approach, I'd suggest an unbound textbox
where you can (programmatically) copy data back and forth.

However, perhaps you could say a bit more about why Zoombox won't work?
There may be work-arounds for your problems.

Also - here's another thought:
you might be able to put your editing box on a separate page of a tab
control on the same form.

HTH
- Turtle

Hope someone can help me with this little problem, quickly
if possible!

Could someone advise how to set the control source for an
unbound control on a form from another form?

For example, if the user clicks CmdDescription in FormA,
FormB will display the Description for that record. In the
same FormA, if they click CmdSolution, FormB will display
the Solution field, etc.

In essence, what I'm doing is trying to replicate the
Access Zoombox command. (Can't use the built-in Access
Zoombox feature in this instance.)

Here's what I've got thus far in Form A. The unbound
control in FormB that I want to set the Data Control
Source for is named "VaryRecSource". The same table is
used in each form. The field in FormA can be edited, as
well as the field in FormB.

DoCmd.RunCommand acCmdSaveRecord
Dim stDocName As String
Dim stLinkCriteria As String
Dim VaryField As String
stDocName = "FormB"
VaryField = "Description"
stLinkCriteria = "[CARNum]=" & Me![CARNum]
DoCmd.OpenForm stDocName, , , stLinkCriteria

In FormB, the name of the control is "ThisField" and the
control source is =[VaryField]. (Public VaryField is
declared.) The problem appears to be getting the current
value of VaryField from the table, since FormB will be
called from a variety of forms other than FormA.

Any help ASAP will be greatly appreciated.

Christine


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top