If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Update Problem
Derek Brown wrote:
Hi Rick Private Sub Form_Current() Me.ItemForm.Visible = Not Me.NewRecord End Sub Private Sub Form_AfterInsert() Me.ItemForm.Visible = True End Sub Is ItemForm the name of the subform *control* or of the form within? You need to use the name of the control. -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com |
#12
|
|||
|
|||
Update Problem
Hi Rick
I have a form called ItemForm that i inserted into the outer Subform which is called Invoice Form. Is this not the control? In the Module I have code that is writen in the ItemForm and the title of the code (or the container?) is Form_ItemForm. So I assume that this is the control name. Is this correct? Thanks Rick "Rick Brandt" wrote in message . com... Derek Brown wrote: Hi Rick Private Sub Form_Current() Me.ItemForm.Visible = Not Me.NewRecord End Sub Private Sub Form_AfterInsert() Me.ItemForm.Visible = True End Sub Is ItemForm the name of the subform *control* or of the form within? You need to use the name of the control. -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com |
#13
|
|||
|
|||
Update Problem
Hi Rick
Thought I would let you know that I have solved the problem (with your help) Although I wish I understood what I did. I put this in the lower sub or the inside sub Private Sub Form_Current() Me.Visible = Not Me.NewRecord End Sub Works great but why would Me.Visible Work in the inner sub when Me.ItemForm.Visible would not in the higher subform? "Derek Brown" wrote in message ... Hi Rick I have a form called ItemForm that i inserted into the outer Subform which is called Invoice Form. Is this not the control? In the Module I have code that is writen in the ItemForm and the title of the code (or the container?) is Form_ItemForm. So I assume that this is the control name. Is this correct? Thanks Rick "Rick Brandt" wrote in message . com... Derek Brown wrote: Hi Rick Private Sub Form_Current() Me.ItemForm.Visible = Not Me.NewRecord End Sub Private Sub Form_AfterInsert() Me.ItemForm.Visible = True End Sub Is ItemForm the name of the subform *control* or of the form within? You need to use the name of the control. -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com |
#14
|
|||
|
|||
Update Problem
Derek Brown wrote:
Hi Rick Thought I would let you know that I have solved the problem (with your help) Although I wish I understood what I did. I put this in the lower sub or the inside sub Private Sub Form_Current() Me.Visible = Not Me.NewRecord End Sub Works great but why would Me.Visible Work in the inner sub when Me.ItemForm.Visible would not in the higher subform? That code will make it impossible for you to ever add a new record in the last subform. Did you see my last message about using the name of the subform control rather than the name of the form within it? -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com |
#15
|
|||
|
|||
Update Problem
Hi Rick
Perhaps some of the newsgroup postings are not comming through at the correct time. I sent a post before the last one that answered your post here it is again. Hi Rick I have a form called ItemForm that i inserted into the outer Subform which is called Invoice Form. Is this not the control? In the Module I have code that is writen in the ItemForm and the title of the code (or the container?) is Form_ItemForm. So I assume that this is the control name. Is this correct? Does that help? Thanks Rick "Rick Brandt" wrote in message . net... Derek Brown wrote: Hi Rick Thought I would let you know that I have solved the problem (with your help) Although I wish I understood what I did. I put this in the lower sub or the inside sub Private Sub Form_Current() Me.Visible = Not Me.NewRecord End Sub Works great but why would Me.Visible Work in the inner sub when Me.ItemForm.Visible would not in the higher subform? That code will make it impossible for you to ever add a new record in the last subform. Did you see my last message about using the name of the subform control rather than the name of the form within it? -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com |
#16
|
|||
|
|||
Update Problem
Derek Brown wrote:
Hi Rick Perhaps some of the newsgroup postings are not comming through at the correct time. I sent a post before the last one that answered your post here it is again. Hi Rick I have a form called ItemForm that i inserted into the outer Subform which is called Invoice Form. Is this not the control? In the Module I have code that is writen in the ItemForm and the title of the code (or the container?) is Form_ItemForm. So I assume that this is the control name. Is this correct? Does that help? The newer versions of Access make this more confusing by showing the design view of subforms at the same time you are viewing the design of the parent form. Basically if you open the parent form in design view and click ONCE on the subform then you will be setting focus to the subform *control* and its name will be displayed in the property sheet. If you click again on the subform the property sheet will change to displaying the properties of the form embedded within the subform control. You want to change the visibility of the control, not the form. Often the name of both is the same, but you can't be certain of that unless you check it. -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com |
#17
|
|||
|
|||
Update Problem
Hi Rick
You were correct that code did not allow data entry. This does but still seems a crude way to do it: Into lowest subform I put: Private Sub Form_Current() If IsNull(Forms!MainForm!InvoiceForm.Form!AccountCode ) = False Then Me.Visible = True Else Me.Visible = False End If End Sub "Rick Brandt" wrote in message . net... Derek Brown wrote: Hi Rick Thought I would let you know that I have solved the problem (with your help) Although I wish I understood what I did. I put this in the lower sub or the inside sub Private Sub Form_Current() Me.Visible = Not Me.NewRecord End Sub Works great but why would Me.Visible Work in the inner sub when Me.ItemForm.Visible would not in the higher subform? That code will make it impossible for you to ever add a new record in the last subform. Did you see my last message about using the name of the subform control rather than the name of the form within it? -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com |
#18
|
|||
|
|||
Update Problem
Derek Brown wrote:
Hi Rick You were correct that code did not allow data entry. This does but still seems a crude way to do it: Into lowest subform I put: Private Sub Form_Current() If IsNull(Forms!MainForm!InvoiceForm.Form!AccountCode ) = False Then Me.Visible = True Else Me.Visible = False End If End Sub The problem with using the current event of the subform to hide "itself" is that once the event triggers a "visible = false" then you have no ability to move to another record to undo that since once the form is hidden you can no longer navigate in it (it's a one way street). I really can't think of any reason why the current event of the parent form doesn't work for you. I have done this numerous times and it has never been an issue. -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com |
#19
|
|||
|
|||
Update Problem
Thanks Rick
The reason I am getting away with this is because If no data exists in the inner subform then I don't want the ability to make it visible. I want to force the user to click a button on the outer subform which then enters a few standard details (invoice number etc) and with the Dirty statement causes the sub to save the record creating a link between the outer sub and the main form and finishes with an instruction to make the inner subform visible only after this event. Also the inner sub is in multirecord format. I am just concerned that I never seem to find "the right way" I just make it work, it fels like sellotape and chewing gum to me.! I will persivere with the method you originally suggested until it works. One problem I found was moving the focus to the inner sub, but I have taken that out and still have problems. Anyway it now works so thank you for your help!! "Rick Brandt" wrote in message om... Derek Brown wrote: Hi Rick You were correct that code did not allow data entry. This does but still seems a crude way to do it: Into lowest subform I put: Private Sub Form_Current() If IsNull(Forms!MainForm!InvoiceForm.Form!AccountCode ) = False Then Me.Visible = True Else Me.Visible = False End If End Sub The problem with using the current event of the subform to hide "itself" is that once the event triggers a "visible = false" then you have no ability to move to another record to undo that since once the form is hidden you can no longer navigate in it (it's a one way street). I really can't think of any reason why the current event of the parent form doesn't work for you. I have done this numerous times and it has never been an issue. -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to update these figures? | Yorkie118 | Running & Setting Up Queries | 11 | October 22nd, 2005 05:56 PM |
update query problem | Yorkie118 | Running & Setting Up Queries | 0 | October 20th, 2005 03:03 PM |
Why did update cause "requires valid sender domain" problem? | E. Thomas Wood | General Discussion | 0 | June 19th, 2005 07:15 PM |
KB837009 update problem | [email protected] | Outlook Express | 29 | May 21st, 2005 05:45 PM |
Update problem | Jens Burup | Running & Setting Up Queries | 4 | October 7th, 2004 10:05 PM |