Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime query on other computer beheves different 1

Status
Not open for further replies.

Niebotel

Programmer
Jan 1, 2007
169
NL
In my application in Access 2007 I have a form with a button. If I click on the button a report starts with a query which gets the record based on the ID which is dislayed on the form.
In normal access operation it works well. In runtime on my own computer it works well. If I run the program on a other computer (runtime) the program query prompts for the ID.
Complicated to test.

If I do not find the answer why this happens, I should like to have a work around to print e record which is active on a form (with a simple query attached to the report)

The query looks like:
SELECT Tankbeurten.Id, Tankbeurten.Datum, Tankbeurten.Klantnaam, Tankbeurten.Bootnaam, Tankbeurten.Thuishaven, Tankbeurten.Adres, Tankbeurten.Postcode, Tankbeurten.Woonplaats, Tankbeurten.Land, Tankbeurten.LitersBenzine1, Tankbeurten.LitersBenzine2, Tankbeurten.LitersBenzine3, Tankbeurten.LitersDiesel1, Tankbeurten.LitersDiesel2, Tankbeurten.LitersDiesel3, Tankbeurten.DieselDagPrijs, Tankbeurten.BenzineDagPrijs, Tankbeurten.Pompnummer2, Tankbeurten.Pompnummer1, Tankbeurten.Pompnummer3, Tankbeurten.TotaalBedrag, Tankbeurten.ToeslagFactor, Tankbeurten.[Te betalen], Tankbeurten.BTW, Tankbeurten.KasBedrag, Tankbeurten.PinBedrag, Tankbeurten.RekBedrag, Tankbeurten.Betalingsvorm, Tankbeurten.Afgesloten, Tankbeurten.Betaald, Tankbeurten.Boeknummer, Tankbeurten.Korting, Tankbeurten.Artikel
FROM Tankbeurten
WHERE (((Tankbeurten.Id)=[Formulieren]![Tanken]![ID]));
 
What version are you using?
I would start by checking the options on both computers. In 2007-2010 look under Object Designers.
I would also check the size of the DB.
 
That is not possible in a runtime version, I believe.
 
I'm sorry, you did say you were using 2007. It's rather emotional around here because someone is retiring.
 
Have you tried using the where condition of the DoCmd.OpenReport method? You would remove the where clause from the report's record source.

Code:
Dim strWhere as String
strWhere = "Id= " & Me.ID
DoCmd.OpenReport "Your Report Name", acViewPreview, , strWher


Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top