How to dynamically change field data source on a form (1 Viewer)

Christine Pearc

Christine
Local time
Today, 06:09
Joined
May 13, 2004
Messages
111
I would like to create a button on FormA which will open FormB. Easy enough. However, I want the data source for the (single) field on FormB to vary depending on the variable I set in FormA. Can someone tell me how to to do this? Here's the code in FormA that I have thus far:

Private Sub cmdZoom_Click()

Dim mZoomField as string
mZoomField = me.Description
DoCmd.OpenForm "frm Zoom", , , stLinkCriteria = "[CARNum]=" & Me![CARNum]

End Sub


Many thanks!
Christine
 

Christine Pearc

Christine
Local time
Today, 06:09
Joined
May 13, 2004
Messages
111
Hi, Rich.

When the user clicks the command button, it will open a form to give a full-screen display of a memo field. I figured it would be easier for users to edit and read the contents when there's lots of information in there. I want to be able to use the zoom form for a variety of forms, and for forms that have more than one memo field.
 
R

Rich

Guest
Use the built in Zoom box
Shift + F7 or DoCmd. RUNCOMMAND acCMD ZOOMBOX, is that easier?
 

Christine Pearc

Christine
Local time
Today, 06:09
Joined
May 13, 2004
Messages
111
Hi again, Rich. Well, that command certainly would be lots easier, but I can't get it to work! Since I'm using the command button to call the zoombox, how does it know which field I want it to zoom in on? (I can't use a double-click event procedure, etc. since it is being used for something else.)

Private Sub cmdZoom_Click()
DoCmd.RunCommand acCmdZoomBox

Note also, if a forget about the command button and just press Shift+F7, nothing happens. :confused:
 

Christine Pearc

Christine
Local time
Today, 06:09
Joined
May 13, 2004
Messages
111
Update: I just created a new memo field and dropped it onto my form and used the field's on double-click event to run the zoom command. It worked. However, this zoom box, nice as it is, won't meet my needs since (a) it's too small and (c) the text box I'm zooming in on is a rich text control (from Stephan Lebans), which already has it nice formatting toolbar.

So, Rich - and anyone else who can help -, I'm back to my original question!

Christine
 

Users who are viewing this thread

Top Bottom