Query disappears when export to word

S

Stardust22

I'm working in a access database that someone else have created and I have
never worked in access before.

There is a very complicated SQL-query that makes it possible to filter
before you export the information to word, but when I do this the SQL-query
disappears, the quetion window becomes blank. What can be the problem? Is
this common in access?
 
A

Aaron

Stardust22 said:
I'm working in a access database that someone else have created and I have
never worked in access before.

There is a very complicated SQL-query that makes it possible to filter
before you export the information to word, but when I do this the
SQL-query
disappears, the quetion window becomes blank. What can be the problem? Is
this common in access?
TEST!
 
J

John W. Vinson

I'm working in a access database that someone else have created and I have
never worked in access before.

There is a very complicated SQL-query that makes it possible to filter
before you export the information to word, but when I do this the SQL-query
disappears, the quetion window becomes blank. What can be the problem? Is
this common in access?

How are you doing the export? What specific steps are you taking?

No, the Query object should emphatically NOT disappear.
 
S

Stardust22

"John W. Vinson" skrev:
How are you doing the export? What specific steps are you taking?

No, the Query object should emphatically NOT disappear.

There is a form where the user can write parameters in combination boxes and
with a command button. When you click on the button the query uses the
parameters to chose which posts should be exportet. The command button was
created with the guide (report operations=>send report to file.. and so on)
 
S

Stardust22

Stardust22 said:
"John W. Vinson" skrev:
How are you doing the export? What specific steps are you taking?

No, the Query object should emphatically NOT disappear.
There is a form where the user can write parameters in combination boxes and
with a command button. When you click on the button the query uses the
parameters to chose which posts should be exportet. The command button was
created with the guide (report operations=>send report to file.. and so on).
The query do not disappear every time, but often, this is very confusing...
 
J

John W. Vinson

"John W. Vinson" skrev:


There is a form where the user can write parameters in combination boxes and
with a command button. When you click on the button the query uses the
parameters to chose which posts should be exportet. The command button was
created with the guide (report operations=>send report to file.. and so on)

Care to post the actual code? I can't see it from here.
 
S

Stardust22

John W. Vinson said:
Care to post the actual code? I can't see it from here.

The qeury is:
SELECT Prov.[MS version], Prov.[Prov Id], [Anm Fpl39].[Anmärkning Id], [Anm
Fpl39].Materielgrupper, [Anm Fpl39].Anmärkning, [Anm Fpl39].[TDR/PR], [Anm
Fpl39].Uppföljning
FROM ((((Prov INNER JOIN [Anm Fpl39] ON Prov.[Prov Id]=[Anm Fpl39].[Prov
Id]) LEFT JOIN Flygplan ON Prov.Flygplan=Flygplan.Flygplan) LEFT JOIN
Flygförare ON Prov.Flygförare=Flygförare.Flygförare) LEFT JOIN [MS version]
ON Prov.[MS version]=[MS version].[MS version]) LEFT JOIN Provledare ON
Prov.Provledare=Provledare.Provledare
WHERE (((Prov.Datum) Between Forms![Urval Fpl39]!Startdatum And Forms![Urval
Fpl39]!Slutdatum) And ((Forms![Urval Fpl39]!Flygplansval=' Alla poster') Or
(Prov.Flygplan=Forms![Urval Fpl39]!Flygplansval)) And ((Forms![Urval
Fpl39]!Flygförarval=' Alla poster') Or (Prov.Flygförare=Forms![Urval
Fpl39]!Flygförarval)) And ((Forms![Urval Fpl39]!Provledarval=' Alla poster')
Or (Prov.Provledare=Forms![Urval Fpl39]!Provledarval)) And ((Forms![Urval
Fpl39]!MSval=' Alla poster') Or (Prov.[MS version]=Forms![Urval
Fpl39]!MSval)) And ((Forms![Urval Fpl39]![Materielgrupp val]=' Alla poster')
Or ([Anm Fpl39].Materielgrupper=Forms![Urval Fpl39]![Materielgrupp val])) And
((Forms![Urval Fpl39]!Statusval=' Alla poster') Or ([Anm
Fpl39].Uppföljning=Forms![Urval Fpl39]!Statusval)) And (((([Anm
Fpl39].TRAB)=Forms![Urval Fpl39]!TRAB) Or ((Forms![Urval Fpl39]!TRAB)=0)) And
((([Anm Fpl39].DA)=Forms![Urval Fpl39]!DA) Or ((Forms![Urval Fpl39]!DA)=0))
And ((([Anm Fpl39].SC)=Forms![Urval Fpl39]!SC) Or ((Forms![Urval
Fpl39]!SC)=0))))
ORDER BY [Anm Fpl39].Materielgrupper;

Code for form:

Option Compare Database

Private Sub Förhandsgranska_Förarutrustning_Click()
On Error GoTo Err_Förhandsgranska_Förarutrustning_Click

Dim stDocName As String

stDocName = "Sammanställning anmärkningar Förarutrustning"
DoCmd.OpenReport stDocName, acPreview

Exit_Förhandsgranska_Förarutrustning_Click:
Exit Sub

Err_Förhandsgranska_Förarutrustning_Click:
MsgBox Err.Description
Resume Exit_Förhandsgranska_Förarutrustning_Click

End Sub

Private Sub Förhandsgranska_Stödsystem_D_Uh_Click()
On Error GoTo Err_Förhandsgranska_Stödsystem_D_Uh_Click

Dim stDocName As String

stDocName = "Sammanställning anmärkningar Stödsystem D/Uh"
DoCmd.OpenReport stDocName, acPreview

Exit_Förhandsgranska_Stödsystem_D_Uh_Click:
Exit Sub

Err_Förhandsgranska_Stödsystem_D_Uh_Click:
MsgBox Err.Description
Resume Exit_Förhandsgranska_Stödsystem_D_Uh_Click
End Sub

Private Sub Förhandsgranska_Stödsystem_Utb_Click()
On Error GoTo Err_Förhandsgranska_Stödsystem_Utb_Click

Dim stDocName As String

stDocName = "Sammanställning anmärkningar Stödsystem Utb"
DoCmd.OpenReport stDocName, acPreview

Exit_Förhandsgranska_Stödsystem_Utb_Click:
Exit Sub

Err_Förhandsgranska_Stödsystem_Utb_Click:
MsgBox Err.Description
Resume Exit_Förhandsgranska_Stödsystem_Utb_Click
End Sub

Private Sub Förhandsgranska_Stödsystem_Fpl_Click()
On Error GoTo Err_Förhandsgranska_Stödsystem_Fpl_Click

Dim stDocName As String

stDocName = "Sammanställning anmärkningar Stödsystem Fpl"
DoCmd.OpenReport stDocName, acPreview

Exit_Förhandsgranska_Stödsystem_Fpl_Click:
Exit Sub

Err_Förhandsgranska_Stödsystem_Fpl_Click:
MsgBox Err.Description
Resume Exit_Förhandsgranska_Stödsystem_Fpl_Click
End Sub

Private Sub Förhandsgranska_vapen_Click()
On Error GoTo Err_Förhandsgranska_vapen_Click

Dim stDocName As String

stDocName = "Sammanställning anmärkningar Vapen"
DoCmd.OpenReport stDocName, acPreview

Exit_Förhandsgranska_vapen_Click:
Exit Sub

Err_Förhandsgranska_vapen_Click:
MsgBox Err.Description
Resume Exit_Förhandsgranska_vapen_Click
End Sub

Private Sub Förhandsgranska_Yttre_Last_Click()
On Error GoTo Err_Förhandsgranska_Yttre_Last_Click

Dim stDocName As String

stDocName = "Sammanställning anmärkningar Yttre Last"
DoCmd.OpenReport stDocName, acPreview

Exit_Förhandsgranska_Yttre_Last_Click:
Exit Sub

Err_Förhandsgranska_Yttre_Last_Click:
MsgBox Err.Description
Resume Exit_Förhandsgranska_Yttre_Last_Click
End Sub


Private Sub Förhandsgranska_Fpl39_Click()
On Error GoTo Err_Förhandsgranska_Fpl39_Click

Dim stDocName As String

stDocName = "Sammanställning anmärkningar Fpl39"
DoCmd.OpenReport stDocName, acPreview

Exit_Förhandsgranska_Fpl39_Click:
Exit Sub

Err_Förhandsgranska_Fpl39_Click:
MsgBox Err.Description
Resume Exit_Förhandsgranska_Fpl39_Click
End Sub
Private Sub konvertera_Fpl39_Click()
On Error GoTo Err_konvertera_Fpl39_Click

Dim stDocName As String

stDocName = "Fråga Fpl39 Export"
DoCmd.OutputTo acQuery, stDocName, , , True

Exit_konvertera_Fpl39_Click:
Exit Sub

Err_konvertera_Fpl39_Click:
MsgBox Err.Description
Resume Exit_konvertera_Fpl39_Click

End Sub

For me this looks really complicated..

Thanks in advance!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top