Full Version: I have done this in the past, today I have a brain freeze....
UtterAccess Forums > Microsoft® Access > Access Forms
sredworb
I am trying to synchronize subforms and for the life of me can't remember how to do it.
I have tried the example with the orderID over and over, so please don't recommend that one.
Oremember that it's not too difficult, I just can't recall it.
Any help would be greatly appreciated.
Thanks
Jerry
Shane
I may be wrong but it appears that you have based the subfom on a query and not the form that you have created.
If you had used a continious subform then all you have to do is put some code in the OnGotFocus event of the subform to go to the appropiate record in the main form.
Hope this helps
Shane
jmcwk
Hello Jerry,
Have you tried this on the click event of the form?
DoCmd.OpenForm "yourform", acNormal, , "[yourPKontheformyouwantto open] = " & Me.yourcorrespondingcontrol on your arresthistoryform & "", acFormEdit, acWindowNormal
DoCmd.Close acForm, Me.Name
sredworb
Tried the above offers but all failed...
appreciate the attempt.
Still trying to Solve this issue.
Can you please help?
Jerry
jmcwk
Morning Jerry,
Not sure this is what you are after but click on either Gambling OR Tresspass
sredworb
Hi John,
It's close brother, just don't want the form to close.
By the way, I take it you had a safe trip.. All is well I hope.
Thanks for the reply
I am going to see if I can modify your coding...
Thanks Again..
Jerry
jmcwk
Jerry,
o problem, Thanks for asking but we are not leaving until Friday. Just curious why do you have the Arrest form as it is above the Arrest History rather than having just the arrest history on your frmPerson? Would it be better for you to have the Arrest History as you have it to enter the arrests then if the record needs editing etc. click the Arrest History to open the stand alone frmArrest Not dictating here just curious on the layout.
sredworb
Hi John,
put the arrest history under the arrest form so if a detective is viewing someone/entering a new entry you get a quick look at what the offender has been arrested for in the past. Some of my fellow officers are not computer literate, just as an example, one asked me if the printer has to be turned on and off before using it if it has been on all day...
So simplicity has to be the word of the day..
Ocan go on for days...
Jerry
ps. Drive/Travel safely and have a good trip John.
jmcwk
Thanks Jerry Need more help I will do what I can!
sredworb
Thanks John..
Tomolena
Jerry,
It seems synchronized to me now. But I'm not sure its what you want. Exactly what is failing for you?
sredworb
Check this out, this will explain it.
erry
Jack Cowley
In the first subform I use code like this in the On Current event to fill a hidden control on the main form:
e.Parent.HiddenControlName = Me.NameOfControlWithIDUsedInSecondSubform
In the second subform I set the MasterLink to the hidden control on the main form. Selecting a record in the first subform filters the second subform....
I hope this is what you are after.
Jack
sredworb
Hi Jack,
This has been driving me insane,,I'll give your way a shot..
Thanks
Jack Cowley
Let us know if it works for you....
ack
sredworb
Hi Jack
Not working for me.
1st SubForm is frmArrest pkArrestID>>Pk of tblArrest
fkPresonID
2nd SubForm (ContinuousForm) frmArrestHistory
pkArrestID >>Pk of tblArrest
fkPersonID
I had this initially based off a query, (2nd Subform) someone posted that I should try a continous form.
Something is obviously missing, other than my sanity....
Jerry
Jack Cowley
Jerry -
You have a table tblArrest and do you have a table tblArrestHistory? If so, then tblArrestHistory should be in a subform on a form based on tlbArrest.
My thinking is that tlbArrest is based on a person and that person can have many arrests therefore the second table. Am I on the right track or am I missing the boat?
Jack
sredworb
You're on it..
I have tblArrest, I based the sfrmArrestHistory off of tblArrest as well as frmArrest. I am using the subform sfrmArrest just as a "Quick View" off all the times the person has been arrested. I did this on a different database but used a query to show the resutls. I also linked it up and synched it too. Like an idiot, I deleted the db thinking, if I come across that again I know how to do it...OOOPPPSSS...
Since nothing would really go into table arrest history other then what is already in tblArrest there should be no reason for duplicating information.
I'm lost.......
If you have a moment, would you please see the attachment and tell me what/where I lost it.
Thanks Jack,
Jerry
Jack Cowley
Jerry -
You are not going to like what I have to say, but your table tblArrest is not normalized. Also, why a Random Autonumber for the PK? Now that I have that out of the way your main form should be based on tblPerson and the subform on tblArrests. Be that as it may, take a look at Form1 and the not-so-hidden text box. Click in any control on the top subform to see the details in the bottom subform.
hth,
Jack
Tomolena
Sorry Jerry. It's been a little hectic here today. I made some minor modifications. Tell me if this is what you're looking for and if not, why.
Edited by: Tomolena on Wed May 24 16:57:38 EDT 2006.
sredworb
Jack,
This is what I want,
I thought my tables were normalized, you got to remember that I sent a chopped up version.
The main form is base on tblPerson. (It's the one with the place for the photo) I chose a random number due to this being only part of a larger db set up..this will ensure no duplicates...
I just have to figure out how to adapt your setup to mine..
Thanks for the help,
You're a good man Jack.
Jerry
sredworb
Lt.
can't see what you did, looks the same to me. Perhaps you sent the wrong one back, being hectic in the big apple....
Jack Cowley
Jerry -
On your table tblArrest all value from Felony to Resisted Arrest should be in a table that looks like:
tblOffenses
OffenseID
Offense
Then put the OffenseID in the Offense field of the arrest table OR if this is more than one offense in a single arrest then create a junction table as well....
hth,
Jack
zaxbat
Hmmm....seems to me that you have arrest history as a subform of arrests...(so it is subordinate to arrests)....but conversly you have arrest history as the master and arrest as the child in the link up. It confuses me and I guess Access doesn't know what to do with it either.
sredworb
Hi Jack,
follow you know.
DB is begining to work like I wanted it to, THANKS TO MR. JACK...
Only problem I have now is, I guess, a filtering issue.
If you look you will see that all the arrest recorded are coming up for every person.
I have been trying to figure out how to sort the records since the link fields have been modified.
Any Suggestions. DB is attached...
Jerry
Jack Cowley
Jerry -
nother way to show the offenses is to select it from the combo box on the form as demonstrated in the attached. Moving to a new offender (record) on the main form properly shows their offenses in the frmArrest.
Just another way to skin the ol' Access cat....
Jack
sredworb
Well, Jack...
You have just changed the face of my database....
Omentioned Simplicity is needed more then oxygen at my workplace and you have topped it.
Thanks Pal..
Jerry.
ps. didn't even think about a cbo....
sredworb
Jack,

Took your combo box and added a few things, then turned it into a list box and now and added some sorting to it, VIOLA...four days of brain pain..right out the door.....

Thanks Jack

Jerry

Edited by: khaos on Thu May 25 11:23:14 EDT 2006.
Language issue here as well - Khaos
sredworb
Hey Lt.
Check out this version, trying to figure out a Name for the Database " Arrest Tracker ",
Need to come up with some kind of Police Jargon Name..

At a lost.

Jerry
Edited by: Larry Larsen on Thu May 25 10:33:14 EDT 2006.
Jack Cowley
Jerry -
I'm glad you beat me to the list box as that is what came to mind when I woke up this morning! Well, you got up earlier than I did and that may have had something to do with it....
I am glad that you have your db working the way you want!
I have lots of names that I could suggest for the db, but this is a family site so use your good cop imagination...
Jack
sredworb
Thanks again Jack.
eally appreciate all the thought you have given to my dilema.
Ocontacted a moderator cause someone around my pd, obviously decided to add some foul language to one of my entries, hopefully they deleted the attachment or the remark..
But anyway, on a serious note, thanks again Jack and enjoy a glass of your finest / favorite wine on me...
Jerry
Jack Cowley
Jerry -
did not see the bad language, but it was probably taken care of by the moderator you notified. Thank you for letting us know, as good manners are appreciated by everyone....except the young cop who thought he was being cute....
I am looking forward to a nice chilled glass of Chardonnay or Pinot Grigio tonight and I will raise a glass for you. Thank you and I am glad that UA was able to help you with your database! thumbup.gif
Jack
sredworb
LT,
Latest version, not yet finished.
Looking for a name.
Jerry
jmcwk
"MPL"
cCook Police LockUp
truittb
McArrest
sredworb
Thanks to everyone, finally came up with a name "Perp Search" credit to Tomolena from NYPD.
Appreciate everyone's input..
John: liked your idea but this is just going to be ued by the detectives to track criminals we have tracked down or interviewed / they confessed and we charged them. If a case comes back to the dics then it stays seperate from the patrol files..Really bass ackwards...
Truittb: Your selection seems, not to insult you, I appreciate the suggestion, but it sounds like something off a mcdonald's menu...Hope your laughing...... laugh.gif
Thanks again everybody,
Jerry
truittb
Hmmm... I think my inspiration was the McD's menu. o! (No DUI)
sredworb
Hey Tommy,
etting near the end, see if there is anything that can be changed / upgraded etc.
Thanks
Jerry
Tomolena
Excelent! I like the drop shadows in the images. Also like the way the perp picture takes center stage with pedigree stuff on the left and detail stuff on the right...good symetry. They say you shouldn't have overlaping controls, but you did those subforms well...having them appear and disappear in response to the cmd buttons. I would have done it the same way.
hanges?
Just minor ones.
After the user selects his username from the login combo, the Enter or Tab key should put him in the password field.
I would rethink the font forecolors on those command buttons in the mainform
The PD logo on the top left is sufficient. The other one beneath the perp picture seems a bit redundant.
Lastly...
After pressing the Enter key in the FBI field shouldn't I be in the Date field on the upper right? I'm not sure where the focus is going.
GREAT JOB
sredworb
Thanks for the comments,
ill check it out and make changes accordingly..
Thanks Again.
Jerry
AccDB4Free
Hey Jerry,
ice work, mind if I use it for our community detective office?
Of course, it will be redesign as per our requirement, can you assist me?
Thanks,
ca
sredworb
AccDB4Free
If you want to give me a few more days, I plan on making some (Tweaking) it up a little.
But yeah, If you can use it too by all means do. This is just a part of a larger whole reporting system I have been working on for a few months.
When I finish it I will make sure to let you know.
Jerry
AccDB4Free
Hi Jerry,
Thanks, I would appreciate if you can share that db after your tweaking, actually I have already started on re-designing, because the officer incharge in our community is very eager to use after I show him your db..
Actually I am not making all the db's I am creating for a profit, just a fun and practise.
Thanks jerry,
ca
sredworb
Hi Ca,
eah, as soon as I am finished with it, I will track you down and IM you so you can grab the finished copy.
I'm flattered that you like it, thanks.
Jerry
AccDB4Free
Thanks Jerry,
really appreciate your good gesture.
If you need to email me private, do so at "cagay_anos@yahoo.com", or PM me here.
Have a great day,
ca
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.