Connecting Tech Pros Worldwide Forums | Help | Site Map

Continuous Forms (again?)

Armando
Guest
 
Posts: n/a
#1: Nov 13 '05
I recently saw the tail end of a "Continuous forms" discussion, but not
enough was available to see if this will be a PITA repeat question. Sorry
if it is.



On a form with its Default View set to Continuous Forms, I need to catch the
event when the repeating section iterates for each record in the underlying
table. I have buttons on the repeating section which will get their
captions from the current line in the table, or which will disappear when
its data is blank. So, I need a useful event to hang some code on, so that
I can refer to the controls on the current line while I still have the
context. I have tried using a subform on the repeating section (so I can
try to use its OnOpen event), but it's not allowed.



Maybe it's something I have to do AFTER all the lines are shown? Open the
form as a recordset and move through it? Any ideas welcome!



Then I have to figure out which record the user is in when a button is
pressed.



Thanks in advance,



Armando




MacDermott
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Continuous Forms (again?)


You've got a number of issues going on here:
If you put a button on a continuous form, its caption will always be the
same for each record.
If you want the text displayed on a control to vary from record to record,
you MUST use a control which is bound to the underlying recordset. A
textbox might be a good choice for this, especially because:
1. You can set its control source to be controlled by the specific record.
2. You can set its locked property to True if needed, so that it can't be
edited directly.
3. You can set its borderstyle to raised, so it looks a bit like a button.
4. Using conditional formatting, while you can't quite make it disappear,
you can disable it if certain conditions are met by that record.
5. A textbox has an OnClick event which can be programmed much like a
button's.

HTH

"Armando" <armando@bogusaddress.com> wrote in message
news:pghFd.2759$925.258035@news1.epix.net...[color=blue]
> I recently saw the tail end of a "Continuous forms" discussion, but not
> enough was available to see if this will be a PITA repeat question. Sorry
> if it is.
>
>
>
> On a form with its Default View set to Continuous Forms, I need to catch[/color]
the[color=blue]
> event when the repeating section iterates for each record in the[/color]
underlying[color=blue]
> table. I have buttons on the repeating section which will get their
> captions from the current line in the table, or which will disappear when
> its data is blank. So, I need a useful event to hang some code on, so[/color]
that[color=blue]
> I can refer to the controls on the current line while I still have the
> context. I have tried using a subform on the repeating section (so I can
> try to use its OnOpen event), but it's not allowed.
>
>
>
> Maybe it's something I have to do AFTER all the lines are shown? Open the
> form as a recordset and move through it? Any ideas welcome!
>
>
>
> Then I have to figure out which record the user is in when a button is
> pressed.
>
>
>
> Thanks in advance,
>
>
>
> Armando
>
>
>[/color]


Armando
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Continuous Forms (again?)


Yeah, after I posted that, I kept trying other things. I used GoToRecord on
the Form itself, and was able to hit each line separately, read values,
etc - but as soon as I named one button, they all took it. That's when I
knew it was a dead end, and gave up for the night.

I did initially try a bound textbox, made it raised and grey, etc - but I
liked the "click" depression-movement a real button makes. And, I didn't
like that the caption highlights in black, with a flashing cursor, when you
click the textbox (I tried all four combinations of Enabled and Locked to
get rid of it but couldn't). So, I dropped the textbox approach in hopes of
doing it with a button, and my scattered successes in that area kept me
focused there. Now that I have a second opinion that the button won't cut
it, I guess that's my answer. BTW - I don't remember having trouble making
it disappear (just gotta move the focus somewhere else first), but maybe I
hadn't gotten that far the first time.

Thanks!

Armando

"MacDermott" <macdermott@nospam.com> wrote in message
news:lQtFd.5406$KJ2.3211@newsread3.news.atl.earthl ink.net...[color=blue]
> You've got a number of issues going on here:
> If you put a button on a continuous form, its caption will always be the
> same for each record.
> If you want the text displayed on a control to vary from record to record,
> you MUST use a control which is bound to the underlying recordset. A
> textbox might be a good choice for this, especially because:
> 1. You can set its control source to be controlled by the specific[/color]
record.[color=blue]
> 2. You can set its locked property to True if needed, so that it can't be
> edited directly.
> 3. You can set its borderstyle to raised, so it looks a bit like a[/color]
button.[color=blue]
> 4. Using conditional formatting, while you can't quite make it disappear,
> you can disable it if certain conditions are met by that record.
> 5. A textbox has an OnClick event which can be programmed much like a
> button's.
>
> HTH
>
> "Armando" <armando@bogusaddress.com> wrote in message
> news:pghFd.2759$925.258035@news1.epix.net...[color=green]
> > I recently saw the tail end of a "Continuous forms" discussion, but not
> > enough was available to see if this will be a PITA repeat question.[/color][/color]
Sorry[color=blue][color=green]
> > if it is.
> >
> >
> >
> > On a form with its Default View set to Continuous Forms, I need to catch[/color]
> the[color=green]
> > event when the repeating section iterates for each record in the[/color]
> underlying[color=green]
> > table. I have buttons on the repeating section which will get their
> > captions from the current line in the table, or which will disappear[/color][/color]
when[color=blue][color=green]
> > its data is blank. So, I need a useful event to hang some code on, so[/color]
> that[color=green]
> > I can refer to the controls on the current line while I still have the
> > context. I have tried using a subform on the repeating section (so I[/color][/color]
can[color=blue][color=green]
> > try to use its OnOpen event), but it's not allowed.
> >
> >
> >
> > Maybe it's something I have to do AFTER all the lines are shown? Open[/color][/color]
the[color=blue][color=green]
> > form as a recordset and move through it? Any ideas welcome!
> >
> >
> >
> > Then I have to figure out which record the user is in when a button is
> > pressed.
> >
> >
> >
> > Thanks in advance,
> >
> >
> >
> > Armando
> >
> >
> >[/color]
>
>[/color]


MacDermott
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Continuous Forms (again?)


Don't know as I can help you a lot with the depression-movement,
but you can use this as the first line of your OnClick procedure to take
care of the whole "caption" highlighting:
screen.activecontrol.sellength=0
Of course you can use the name of your control instead of
screen.activecontrol
if you like...

HTH

"Armando" <armando@bogusaddress.com> wrote in message
news:8tBFd.2778$925.259982@news1.epix.net...[color=blue]
> Yeah, after I posted that, I kept trying other things. I used GoToRecord[/color]
on[color=blue]
> the Form itself, and was able to hit each line separately, read values,
> etc - but as soon as I named one button, they all took it. That's when I
> knew it was a dead end, and gave up for the night.
>
> I did initially try a bound textbox, made it raised and grey, etc - but I
> liked the "click" depression-movement a real button makes. And, I didn't
> like that the caption highlights in black, with a flashing cursor, when[/color]
you[color=blue]
> click the textbox (I tried all four combinations of Enabled and Locked to
> get rid of it but couldn't). So, I dropped the textbox approach in hopes[/color]
of[color=blue]
> doing it with a button, and my scattered successes in that area kept me
> focused there. Now that I have a second opinion that the button won't cut
> it, I guess that's my answer. BTW - I don't remember having trouble[/color]
making[color=blue]
> it disappear (just gotta move the focus somewhere else first), but maybe I
> hadn't gotten that far the first time.
>
> Thanks!
>
> Armando
>
> "MacDermott" <macdermott@nospam.com> wrote in message
> news:lQtFd.5406$KJ2.3211@newsread3.news.atl.earthl ink.net...[color=green]
> > You've got a number of issues going on here:
> > If you put a button on a continuous form, its caption will always be[/color][/color]
the[color=blue][color=green]
> > same for each record.
> > If you want the text displayed on a control to vary from record to[/color][/color]
record,[color=blue][color=green]
> > you MUST use a control which is bound to the underlying recordset. A
> > textbox might be a good choice for this, especially because:
> > 1. You can set its control source to be controlled by the specific[/color]
> record.[color=green]
> > 2. You can set its locked property to True if needed, so that it can't[/color][/color]
be[color=blue][color=green]
> > edited directly.
> > 3. You can set its borderstyle to raised, so it looks a bit like a[/color]
> button.[color=green]
> > 4. Using conditional formatting, while you can't quite make it[/color][/color]
disappear,[color=blue][color=green]
> > you can disable it if certain conditions are met by that record.
> > 5. A textbox has an OnClick event which can be programmed much like a
> > button's.
> >
> > HTH
> >
> > "Armando" <armando@bogusaddress.com> wrote in message
> > news:pghFd.2759$925.258035@news1.epix.net...[color=darkred]
> > > I recently saw the tail end of a "Continuous forms" discussion, but[/color][/color][/color]
not[color=blue][color=green][color=darkred]
> > > enough was available to see if this will be a PITA repeat question.[/color][/color]
> Sorry[color=green][color=darkred]
> > > if it is.
> > >
> > >
> > >
> > > On a form with its Default View set to Continuous Forms, I need to[/color][/color][/color]
catch[color=blue][color=green]
> > the[color=darkred]
> > > event when the repeating section iterates for each record in the[/color]
> > underlying[color=darkred]
> > > table. I have buttons on the repeating section which will get their
> > > captions from the current line in the table, or which will disappear[/color][/color]
> when[color=green][color=darkred]
> > > its data is blank. So, I need a useful event to hang some code on, so[/color]
> > that[color=darkred]
> > > I can refer to the controls on the current line while I still have the
> > > context. I have tried using a subform on the repeating section (so I[/color][/color]
> can[color=green][color=darkred]
> > > try to use its OnOpen event), but it's not allowed.
> > >
> > >
> > >
> > > Maybe it's something I have to do AFTER all the lines are shown? Open[/color][/color]
> the[color=green][color=darkred]
> > > form as a recordset and move through it? Any ideas welcome!
> > >
> > >
> > >
> > > Then I have to figure out which record the user is in when a button is
> > > pressed.
> > >
> > >
> > >
> > > Thanks in advance,
> > >
> > >
> > >
> > > Armando
> > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Armando
Guest
 
Posts: n/a
#5: Nov 13 '05

re: Continuous Forms (again?)


More thanks, I'll play with Sellength, it sounds promising.

I was taken by the same goof twice now. I said I didn't have trouble
disappearing a textbox, but of course it's the same as the caption - what
you do to one you do to all (for they all are one). I can't hide just one,
the whole column goes away. So I guess the answer is button-like,
always-active textboxes. I can "disable" them in the OnClick by doing
nothing if blank.

Mucho appreciado,

Armando



Stephen Lebans
Guest
 
Posts: n/a
#6: Nov 13 '05

re: Continuous Forms (again?)


You can somewhat achieve the effect you are looking for using a TextBox
and ConditionalFormatting. THere is a bug in CF that causes it to not
respect the Disabled prop when using the CF GUI to setup the formatting.
YOu have to programmatically manipulate the FormatConditions object to
bypass this bug.

There is sample code/form showing the effect here:
http://www.lebans.com/conditionalformatting.htm


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"Armando" <armando@bogusaddress.com> wrote in message
news:x1HFd.2780$925.261314@news1.epix.net...[color=blue]
> More thanks, I'll play with Sellength, it sounds promising.
>
> I was taken by the same goof twice now. I said I didn't have trouble
> disappearing a textbox, but of course it's the same as the caption -[/color]
what[color=blue]
> you do to one you do to all (for they all are one). I can't hide just[/color]
one,[color=blue]
> the whole column goes away. So I guess the answer is button-like,
> always-active textboxes. I can "disable" them in the OnClick by doing
> nothing if blank.
>
> Mucho appreciado,
>
> Armando
>
>
>[/color]

Closed Thread