Can't get form to link Data

coolcatkelso

Registered User.
Local time
Today, 23:14
Joined
Jan 5, 2009
Messages
279
Hiya

Access 2007

Trying to get a form called Schedule linked in my database. So when you click on the WorkorderID in the subform on the main form it opens and shows the related WorkorderID from the form (Workorders)

Can't get this working at all.

The schedule form should allow the user to list when they attended the job, time date etc and what was done.

I can get it to open the Schedule when I click on the subform WorkorderID, and if I enter the workorderID on the Subform manually it works ok, but I need it done automatically

Anyone help?
________
NEW MEXICO MARIJUANA DISPENSARY
 

Attachments

Last edited:
Hi
Nice database - I think your programming skills go way beyond mine but i think I'm battling with a similar problem and I just posted a new thread. What I tried was to set the "display as hyperlink" property of the ID field to "on screen" so it appears underlined in blue. I'm trying to use OpenForm to launch my new form as an event. I can see you've got other code in the OnClick event but I haven't tried to follow it. However, I changed that property on your db so it looks like this -

img4.png


Now when you click, the new form is launched. however, it's not loading the right data into your new form. I found there's some shonky code you have to put in the WHERE line, to make a filter, using the ! character but although that works for me if I run the subform alone, it doesn't run if the subform is embedded. So we may be stuck on the same problem I think!
 
Hiya m8

Yes sounds like same problem we're stuck on

I did notice however, if I creat a Workorder from the workorder form, and have on that form a basic schedule (without the subform) I can create the schedule and enter the workorderID manually.

Then when on the main page of the DB (Workorders by Customer) and click on the subform WorkorderID, it finds the record no problems.

So I'm thinking somwhere in my mess of code, I have something trying to find the record, and if the record isn't there its asked to make a new one, however, if the linked fields are WorkorderID then this option would just confus the DB.

As it would appear. My DB is trying to find a record within Schedule based on WorkorderID, but if I haven't entered the WorkorderID manually, then it just opens a blank form. So it must be something in the code that I'm missing.
________
LovelyWendie99
 
Last edited:
Hiya m8

Had a look at your post, and although it was helpful, it hasnt really resolved anything on my DB.

Is there a way I can do this?

The forms are as follows

Workorders by Customer (main form)
Workorders hold the workorder
Schedule (Should hold the work carried out per day on that job)

Schedule has the following IDs

SchedID (AutoNumber)
WorkorderID (Number)
CustomerID (NUmber

Workorders by Customer has -

Customer ID (AutoNumber)

And Workorders has
CustomerID (Number)
WorkorderID (AutoNumber)

I need the Workorder form to send the WorkorderID to the Schedule WorkorderID so then I can open the schedule based on that workorder but I fail everytime

When I do manage it by setting the control to that form, it doesn't show a different Schedule for each record, Instead it shows the same record for all workorders but changes the workorderID

Anyone able to have a look and guide me on this?

Cheers
CCK
________
LovelyWendie
 
Last edited:
Update

Got it working fine now

The fix I needed was simple and I couldn't believe I missed it.

For me to link the data from the current form to the other form on WorkorderID, I just needed to enter the default value on the form field for workorderID

So simple, it was overlooked

Cheers for all the help anyway
________
Jarama
 
Last edited:

Users who are viewing this thread

Back
Top Bottom