|
 |
access thread: Maximizing Form
Message #1 by gail711@g... on Tue, 11 Sep 2001 10:05:25
|
|
I have a form, that when opened, maximizes. I have a button on the form
that refreshes the form by closing and reopening it (if there is an easier
way to refresh i'd love to know, me.refresh doesn't work).
However, when you hit this button the form does not maximize.
Sub btnrefresh_click()
num = Me.CurrentRecord
DoCmd.Close
DoCmd.OpenForm "frmempdet"
DoCmd.Maximize
DoCmd.GoToRecord , , acGoTo, num
End Sub
I've tried debugging which has just confused me, it maximizes when you
debug it. Any ideas?
Message #2 by brian.skelton@b... on Tue, 11 Sep 2001 12:18:21
|
|
Can you just requery your form with 'Me.Requery'? this will force the form
to go back to your data tables and re-populate itself.
This sends your current record back to the first record and may make the
record number invalid (if other users are adding data to) so it makes it
slightly more difficult to get back to the current record. Something like
this might work:
Sub btnrefresh_click()
dim rstsearch as recordset
num = Me![ControlHoldingRecordUID]
me.requery
set rstSearch = me.recordsetclone
rstsearch.findfirst "FieldHoldingRecordUID =" & num
if not(rstsearch.nomatch) then
me.bookmark=rstsearch.bookmark
endif
rstsearch.close
set rstsearch = nothing
End Sub
> I have a form, that when opened, maximizes. I have a button on the form
> that refreshes the form by closing and reopening it (if there is an
easier
> way to refresh i'd love to know, me.refresh doesn't work).
> However, when you hit this button the form does not maximize.
>
> Sub btnrefresh_click()
> num = Me.CurrentRecord
> DoCmd.Close
> DoCmd.OpenForm "frmempdet"
> DoCmd.Maximize
> DoCmd.GoToRecord , , acGoTo, num
> End Sub
>
> I've tried debugging which has just confused me, it maximizes when you
> debug it. Any ideas?
Message #3 by gail711@g... on Tue, 11 Sep 2001 15:10:33
|
|
My form has 3 pages in it and the requery does work on the first page, but
not the other two. My first page now maximises when it is refreshed but i
still want the other two pages to maximise.
Message #4 by Brian Skelton <brian.skelton@b...> on Tue, 11 Sep 2001 23:40:01 +0100
|
|
Is it one large form with a couple of page breaks on it? So when you
display it, it looks like three pages? Or are there actually three
seperate forms?
If the first case is true, the requery should requery all the controls.
Send more details...
-BDS
-----Original Message-----
From: gail711@g... [SMTP:gail711@g...]
Sent: 11 September 2001 16:11
To: Access
Subject: [access] Re: Maximizing Form
My form has 3 pages in it and the requery does work on the first page,
but
not the other two. My first page now maximises when it is refreshed but
i
still want the other two pages to maximise.
brian.skelton@b...
Message #5 by gail711@g... on Wed, 12 Sep 2001 09:06:13
|
|
Ok, I have one form with 3 tab controls on it. The two tabs that aren't
working are both seperate forms put onto the tab pages (make sense?). The
first tab works with the requery, and will maximise, the other two only
refresh using the close/open form way but wont maximize. Hope that's a
bit clearer.
Message #6 by brian.skelton@b... on Wed, 12 Sep 2001 10:57:51
|
|
So what you've got is a main form with a couple of sub forms on it.
To force the subforms to requery you need to reference the forms that the
subforms are based on:
Forms!<MainForm>![<Subform Control1 Name>].Form.requery
Forms!<MainForm>![<Subform Control2 Name>].Form.requery
> Ok, I have one form with 3 tab controls on it. The two tabs that aren't
> working are both seperate forms put onto the tab pages (make sense?).
The
> first tab works with the requery, and will maximise, the other two only
> refresh using the close/open form way but wont maximize. Hope that's a
> bit clearer.
Message #7 by gail711@g... on Wed, 12 Sep 2001 11:41:57
|
|
Cheers, that worked, form is now working more or less perfect.
|
|
 |