PDA

View Full Version : question



nepotist
11-04-2008, 01:45 PM
Hello every one,

I need some help with the following issue. Below are Images of two forms

http://img366.imageshack.us/img366/5964/form2ku8.png

http://img352.imageshack.us/img352/7518/form1bd3.png

form one (that is the first pic) was my original design with my project, the subform in this form(the blue color area) is where I add all the intersection information. it works fine

Well to add more options to the user I have decided to add an extra form that is form 2( the second pic) well this form would pop up once the user selects a particular intersection . if you could see there are left, through and right text boxes in all the four directions (which previously is nothing but the left through and right text boxes in the form one) once I or the user puts in numbers and clicks ok in the second form I want the second form to be closed and the same numbers(that were input in the form 2 to be seen in form 1 .

well the subform is based on a query and it updates two tables, and the form 2 is also base don a query whose criteria is based on the combobox value in the sub form..

I confused .. what to do??:dunno

CreganTur
11-05-2008, 08:25 AM
I've read through your question about six times and I think I finally understand what's going on (been one of those days so far :cuckoo:)

Your aerial view form (the 2nd form) needs to save its data to your tables when the user clicks ok. Then when the user moves back to the first form you can requery the form, which should pull the updated values from your table. Either that or you can use DoCmd.OpenForm and use the WHERE CONDITION to open the first form to the correct record, which should open with the correct data showing in your first form IF you have the textboxes bound to the underlying query or table.

Does that answer your question?

nepotist
11-05-2008, 08:56 AM
Hey Randy,
Thank you for getting back to me.. you got it right. I have already been working on your second option. this is what I did.

I created a copy of the query (which is used as source for the subform in form 1) and add to it a criteria (1) Cid = fromB!CId (2) iID = FORMB!IID.
In order to test this these are my steps that I followed:

It is to be noted that Form one is a project edit form.
steps:
1) select a project Id
2) Form 1 with all the project Info pops up
3) Then I click the combobox in the subform(which is nothing but FormB) and select a Intersection (I have a macro that opens Form2 Once the CMBBOX is updated)
4) It ask me to enter the CID AND iID so the my form 2 (in the pic) can load. I understand that this is because my form 2 is now based on the qry which have a criteria

But why is it asking me a parameter value though I have all the information in the form.


You suggestion about requery is nice but say if I have already some info about that intersection with respect to a project (which is my CId) MY FORM TWO SHOULD SHOW UP with those values for that particular record value.

:dunno

nepotist
11-05-2008, 09:26 AM
Hi I uploaded a sample of the database... if that would help you guys understand my problem
Projtmc is my form 1 and tmc dairy is my subform and FrmTMC is my second form

nepotist
11-07-2008, 06:51 AM
any one have any thing to say ???:help :banghead:

nepotist
11-11-2008, 07:01 AM
Hello Can some one help ...:help :help :help

CreganTur
11-11-2008, 09:57 AM
I've got the copy of your database but I'm having a little difficulty making heads or tails of it.

Please provide instructions to recreate the issue that you're seeing, so I can play along at home.

nepotist
12-05-2008, 01:37 PM
I am sorry Randy got busy with other projects .. as this one was pushed back.. AND I did not even receive a message in my email saying that some one has replied to this topic.... which i usually do get .. ..

Here are the instructions..

open form projtmc1
select any project and click update
projtmc should pop up..
projtmc contains a subform TMC dairy which is blue in color..
initally I designed the application so that the user should be updating the all teh 12 text boxex.. but now.. in order to have apictorial view of the intersection I modified it a bit.....
click the combox in the subform adn select a intersection... here actually the frmtmc should pop up which is based on a query that is linked with the intersection you select.
instead of it poping up the frmtmc it askes for the parameter .. that is what I dont understand.. why I am having this porblem ... I have even checkd the tables and i can see it updated..

Did i confuse you ?

I would really appreaciate your help guys..

nepotist
12-08-2008, 11:15 AM
Hello all,
As I stated above that the form doesnt load and asks for a parameter.. I though I would write a code for creating the query which would be the base for the form and then load it.
But I have a error in it as well adn unable to understand it
Here is my code
Private Sub Intersection_ID_AfterUpdate()

Dim db As Database
Dim CID As Long
Dim IID As Double

Dim strsql As String
Dim quedef As QueryDef
CID = Form_TMC_Dairy!Concurrency_ID.Value
IID = Form_TMC_Dairy!Intersection_ID.Value



'On Error GoTo DelQuery


Set db = CurrentDb


strsql = "SELECT TMC_Dairy.Concurrency_ID, TMC_Dairy.Intersection_ID, tblCMSIntersections.Existing_LOS, TMC_Dairy.PT_EL, TMC_Dairy.PT_ET, TMC_Dairy.PT_ER, TMC_Dairy.PT_WL, TMC_Dairy.PT_WT, TMC_Dairy.PT_WR, TMC_Dairy.PT_NL, TMC_Dairy.PT_NT, TMC_Dairy.PT_NR, TMC_Dairy.PT_SL, TMC_Dairy.PT_ST, TMC_Dairy.PT_SR, tblCMSIntersections.East_Bound, tblCMSIntersections.West_Bound, tblCMSIntersections.North_Bound, tblCMSIntersections.South_Bound " _
& "FROM tblCMSIntersections INNER JOIN TMC_Dairy ON tblCMSIntersections.GlobalID = '" & CID & "' " _
& "WHERE (((TMC_Dairy.Concurrency_ID)= '" & CID & "') AND ((TMC_Dairy.Intersection_ID)= '" & IID & "'));"



Set quedef = db.CreateQueryDef("qryIntTMC", strsql)

Exit Sub

DelQuery:
If Err = 3012 Then
DoCmd.DeleteObject acQuery, "qryIntTMC"



Set quedef = db.CreateQueryDef("qryIntTMC", strsql)

Else
MsgBox Err.Description
End If

End Sub


The error that I am getting is a runtime error 3296 "Join Expression not supported.
what do I do...
I have even tried to play around with the double and single qoute in the query but nothing work..
any help here ....
Appreciate you time guys

nepotist
12-09-2008, 09:10 AM
Thanks guys .. problem solved..