|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
My Clerk has highlighted a flaw in my database. As soon as I have sorted it out I will fire her
![]() I have 2 main input forms for all employee data. When I go from one form to another the records go back to the start. Not a major problem but does prove to be a bit of a pain. I tried to do a button command, which does work and links straight to the other form keeping the same record, but it doesnt allow me to see any other records. Is there a way I can go from one form to another, directly linking to the record I was just viewing but not limit me to just that one record? Thanks in advance Fallyhag |
|
#2
|
|||
|
|||
|
It sounds like you are using bound forms. Is this correct?
|
|
#3
|
|||
|
|||
|
UH OH!
I have been sussed so early ![]() Sorry, I dont confess to being an expert here. I just used the Forms wizard. If you have the time could you elaborate a little as to what you think it might be? Many thanks, again ![]() |
|
#4
|
|||
|
|||
|
The form wizard uses bound forms. Basically this means that the test fiels are tied directly you to recordsource(table/query) and the data entry changes act the same as if you were entering data directly into the table
Unbound forms are not tied to a recordsource. You have to write code to select and update your data. Last question Is all you data your are updating on your two forms in the same table? S- |
|
#5
|
|||
|
|||
|
Yes. I have one large table called MAIN DATA. This is where I store the lot, mainly coz the relationship saga baffled the hell out of me
![]() Does this mean I cannot do it? ![]() |
|
#6
|
|||
|
|||
|
What I would do is put all the information on one form. I imagine that you put it on two forms becuase of the amount of data you have toupdate. They way you over come this is by using the tab control. This gives you the ability to have multiple "pages" on one form.
Look at the Sample DB |
|
#7
|
|||
|
|||
|
Back again after a good nights sleep. Before I go to work.....
Yep, I have already used the TABBED Page feature and it works really well, but I needed to create two forms just so there was at least one form that wasnt scary to look at and could have basic data entered in by even the most stupid of idiots. (User friendly form so to speak) Will I have to revise that and join all the info on one form? I would rather not if there was another way??? Oh well, off to work! |
|
#8
|
||||
|
||||
|
Two Forms
Fallyhag,
Have a look at the attached sample db. Both of my forms are from the same table. The main form (frmCompany) will open when the db is opened. Click the company address details and you will see another form with the company address for the company name in the company form. Now click the next arrow in the record selection and you will see that the second form is updated with the correct details. Note that the caption on the second form changes. Hope this is some help to you. Regards.
__________________
Regards, John A |
|
#9
|
|||
|
|||
|
Hi again
Thanks for the last download. To be honest though, I like the idea but dont quite know how you have done it. How have you got the one form controlling the other? And how have you got the title bar display each company name? Kind regards Fallyhag |
|
#10
|
|||
|
|||
|
In the properites of the second form sent to you by ansentry look at the data tab and in the "Filter"
S- |
|
#11
|
|||
|
|||
|
I think I am being nominated for the Thickie of the day competition today.
I have had a look at the filter but still none the wiser. I tried and experimented but nothing. The title bar stayed unchanged and the forms were not in sync. If you have the time, can you advise? Fallyhag |
|
#12
|
|||
|
|||
|
Quote:
Fallyhag, what I do is create the minor forms I want based on the table then open the main form in design view. put in the tab control, slide the form over til I can see the database window, select forms, pick the minor form I want and drag it into the design window of the main form onto the tabe control, size and position, save and view. It usually works for me. Joe |
|
#13
|
||||
|
||||
|
Fallyhag,
Sorry I should have explained the sample db I posted. Open my sample db and go to Modules and you will see module1, you can have a read of this, but the important thing is it must be imported into the db that you want to use the "open two forms" in. 1. Open my db and close frmCompany, now open it in design view. click view /properities click Event and find On Current. click to the right of [Event Procudure] and you will see that three little dots will appear click on them. This will take you into the code, This code syncs the two forms and it uses the funciton IsLoaded from module1. When you have finished close the code window. Now click on the command button "Company Address Details" do the same as above to go to properties / Event and find On Click this time, click ... and view the code. The first thing this code does is Saves the Record, Next make sure that the form is not blank and if it is then it stops you from opening a blank form. If the form is not blank then it opens the form frmAddressDetails with the same companyid and the from frmCompany. 2. Open the from frmAddressDetails in design view click view/properites, event, three dots now find On Current view the code and this is how the Caption changes and shows how the Company name appears in the caption. It also show what happens if you open this form on it own and go to a new record. This would not normally happen. 3. I have attached a new version of the db, what I forgot was the fact that you may want to enter a company name and then open the FrmAddressDetails and put in the companys address. 4. I have also put comment above the code in the forms. Any further question let me know. Regards, |
|
#14
|
|||
|
|||
|
MANY THANKS FOR YOUR HELP ansentry
I will have a go/experiment and get back to you. Thank you! Fallyhag PS: The title bar code worked well Is there a way of displaying more than just one field in the title bar? |
|
#15
|
||||
|
||||
|
Two Forms
Fallyhag,
Yes you can, you can put either controls or text Code:
On Error GoTo Form_Current_Err
'This uses the module1 function IsLoaded and the next line to keep the from in sync.This allows you to click next record on frmCompany and the
'frmAddress details will go to the record with the same companyid (PK).
If (IsLoaded("FrmAddressDetails")) Then
DoCmd.OpenForm "FrmAddressDetails", acNormal, "", "[CompanyID]=[Forms]![FrmCompany]![CompanyID]", acEdit, acNormal
End If
Rem Me.Caption = "Company Name is " & " - " & [CompanyName]
' or
Me.Caption = [CompanyID] & " - " & [CompanyName]
Form_Current_Exit:
Exit Sub
Form_Current_Err:
MsgBox Error$
Resume Form_Current_Exit
Open up the frmCompany and go to view properties event On Current and copy the above the lines starting with Rem and finishing with [CompanyName] past them into the procudure, so that it is the same as the example above. Now when you open the form (frmCompany) you will see the companyid and the company name . if you want the first example remove the rem and then put it in front of the second example. You must do this as you can only have one example at at time. Any further question or you can't get it to work let me know and i will send you an update sample db. Regards, |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Going From One Form To Another |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|