473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Update a form from another form

19
Hi, I have been working on a purchase order form and am trying to add something to it. I currently have a form frmPurchaseOrder and it has 3 tabs in it called header, detail select and detail update. I have a combo box in the detail select tab that allows me to select data from a requisition table "tblRequistion" by requistion number so the user doesn't have re-enter all the information again and that populates the form in a datasheet view. I would like to be able to put in a command button to throw the forms view over to the detail update tab in an append datasheet so that the user can add multiple requistions and add the addtional entries before updating the purchase order table. Can this be done from one form to another? I cannot make it work not matter what i've tried..
Thanks Mark.
Mar 4 '07 #1
5 3677
ADezii
8,834 Expert 8TB
Hi, I have been working on a purchase order form and am trying to add something to it. I currently have a form frmPurchaseOrder and it has 3 tabs in it called header, detail select and detail update. I have a combo box in the detail select tab that allows me to select data from a requisition table "tblRequistion" by requistion number so the user doesn't have re-enter all the information again and that populates the form in a datasheet view. I would like to be able to put in a command button to throw the forms view over to the detail update tab in an append datasheet so that the user can add multiple requistions and add the addtional entries before updating the purchase order table. Can this be done from one form to another? I cannot make it work not matter what i've tried..
Thanks Mark.
To make the detail update Tab the Active Tab, and then to explicitly shift Focus to the Sub-Form contained within that Tab:
Expand|Select|Wrap|Line Numbers
  1. Me!your Tab Control name.Pages(2).SetFocus           '3rd Tab
  2. Me![your Sub-Form control name].SetFocus
Mar 5 '07 #2
mtrcct
19
To make the detail update Tab the Active Tab, and then to explicitly shift Focus to the Sub-Form contained within that Tab:
Expand|Select|Wrap|Line Numbers
  1. Me!your Tab Control name.Pages(2).SetFocus           '3rd Tab
  2. Me![your Sub-Form control name].SetFocus
Thanks for the response. I still can't get it. I set the on click event of the button as follows:

Private Sub AddItemsToPO__DetailsUpdate_Click()
Me!TabCtl16.Pages(2).SetFocus '3rd Tab
Me![frmPurchaseOrderDetailUpdate].SetFocus
End Sub

I get a run error message; "Can't find the field TabCtl16 referred to in your expression"

I aplogize for the lack of understanding here, but forms are my real weak spot. Assuming this would work, how does the information feed to the update form? Would I not have to add addtional coding to append the data?

Thanks Mark.
Mar 5 '07 #3
mtrcct
19
Thanks for the response. I still can't get it. I set the on click event of the button as follows:

Private Sub AddItemsToPO__DetailsUpdate_Click()
Me!TabCtl16.Pages(2).SetFocus '3rd Tab
Me![frmPurchaseOrderDetailUpdate].SetFocus
End Sub

I get a run error message; "Can't find the field TabCtl16 referred to in your expression"

I aplogize for the lack of understanding here, but forms are my real weak spot. Assuming this would work, how does the information feed to the update form? Would I not have to add addtional coding to append the data?

Thanks Mark.
Anyone able to help with this? I am really stuck now.
Mar 6 '07 #4
ADezii
8,834 Expert 8TB
Anyone able to help with this? I am really stuck now.
You may be referencing the wrong Index into the Pages Collection - remember they start at 0 so the 1st Tab would have a value of 0, the 2nd 1, etc. Collections will not automatically adjust their Elements if a Tab should be deleted, etc. To be sure, place the following code in the Change() Event of the Tab Control, then Click on your Tab. If it is not 2 then change the line in the 2nd Code example:
Expand|Select|Wrap|Line Numbers
  1. Private Sub TabCtl16_Change()
  2. On Error GoTo Err_TabCtl16_Change   ' <R22>
  3.   MsgBox Me!TabCtl16.Value
  4. End Sub
Expand|Select|Wrap|Line Numbers
  1. Me!TabCtl16.Pages(<value returned from Msgbox>).SetFocus
If this doesn't work, check for a typo in either the Sub-Form name or the Tab Control name.
Mar 6 '07 #5
mtrcct
19
You may be referencing the wrong Index into the Pages Collection - remember they start at 0 so the 1st Tab would have a value of 0, the 2nd 1, etc. Collections will not automatically adjust their Elements if a Tab should be deleted, etc. To be sure, place the following code in the Change() Event of the Tab Control, then Click on your Tab. If it is not 2 then change the line in the 2nd Code example:
Expand|Select|Wrap|Line Numbers
  1. Private Sub TabCtl16_Change()
  2. On Error GoTo Err_TabCtl16_Change   ' <R22>
  3.   MsgBox Me!TabCtl16.Value
  4. End Sub
Expand|Select|Wrap|Line Numbers
  1. Me!TabCtl16.Pages(<value returned from Msgbox>).SetFocus
If this doesn't work, check for a typo in either the Sub-Form name or the Tab Control name.

Thanks for the reply. I appreciate your help so far, everyone in this forum are great! I still cn't lick this stuppid thing, I am going to tear it down and redesign the update forms..
Mar 7 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Sue Adams | last post by:
I actually have two issues/questions: I have an autonumber field in an access db table that I grab and later use to update a record in another table withing the same db. The code I use to get...
1
by: Primerov | last post by:
Why i cannot update from another form? I have an update function called UpdateData that works otherwise,but not from another form. Why is it so? I am trying to update tables from the form F1.There...
4
by: N. Graves | last post by:
Hello... thank you for your time. I have a form that has a List box of equipotent records and a sub form that will show the data of the equipment select from the list box. Is it possible to...
3
by: Vinay | last post by:
Hello I am trying to update a Progress bar on a form. I am able to update it via using a simple clock timer, but as soon as I perform a long operation G1 (generation of a report) in a separate...
15
by: Darren | last post by:
Help, i want to run an update query from a form.. and was wonderin.. Can the update query run if i want to update a value manually inputted from a form (e.g. !!) to a table...
1
by: Mark Reed | last post by:
Hi All, I'm having a problem with the following code. I've read quite a lot of old posts regarding the issue but none seem to affer a solution. The scenario is. I have a bound form which...
5
by: Stephen Plotnick | last post by:
I'm very new to VB.NET 2003 Here is what I have accomplished: MainSelectForm - Selects an item In a public class I pass a DataViewRow to ItemInformation1 Form ItemInformation2 Form
4
by: Ryan | last post by:
I've got a little bit of code that runs when you enter data in a datasheet view (which is a subform of the form you are in) if rst!DateReceived >= 30 Then Forms!DisposalRecords.Label90.Caption =...
0
by: Access Programming only with macros, no code | last post by:
ERROR MESSAGE: Could not update; currently locked by another session on this machine. BACKGROUND I have the following objects: Table1 - HO (which has about 51,000+ records) Table2 -...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.