AndreasWN
09-25-2007, 06:41 AM
Hi
I'm new with Access and I have this problem that I really hope someone can help me with:
I have some customers in an Access DB and they are separated into the different towns where they live. I want to make a button where I can export the names and adresses of my customers to a comma delimited txt-file, but ONLY the ones who live in the town I decide to view/work with in Access.
I have made a button that exports all customers but as mentioned I only want to export some. The button looks like this:
__________________________________________________ _________________
Private Sub send_rapport_til_fil_Click()
On Error GoTo Err_send_rapport_til_fil_Click
Dim stDocName As String
stDocName = "Klienter Query"
DoCmd.TransferText acExportDelim, , "Klienter Query", "report.txt", False
Exit_send_rapport_til_fil_Click:
Exit Sub
Err_send_rapport_til_fil_Click:
MsgBox Err.Description
Resume Exit_send_rapport_til_fil_Click
End Sub
__________________________________________________ ___________
I also have another button that prints out labels with names of the people in the DB. That button works, so only the names of the selected town will be printed. Maybe I can use something from that string? Anyway it looks like this:
__________________________________________________ ___________
Private Sub Command16_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Me.Refresh
stDocName = "Kuverter"
If param = 1 Then
stLinkCriteria = "[BibliotekID]=" & Me![BibliotekID]
Else
stLinkCriteria = "[BibliotekID]=" & Forms![Klienter Query]![BibliotekID]
End If
DoCmd.OpenReport stDocName, acNormal, , stLinkCriteria
'printes kun 1 gang
End Sub
__________________________________________________ ___________
I really hope someone can help me, I'm in trouble getting this to work.
Thanks in advance.
-Andreas
I'm new with Access and I have this problem that I really hope someone can help me with:
I have some customers in an Access DB and they are separated into the different towns where they live. I want to make a button where I can export the names and adresses of my customers to a comma delimited txt-file, but ONLY the ones who live in the town I decide to view/work with in Access.
I have made a button that exports all customers but as mentioned I only want to export some. The button looks like this:
__________________________________________________ _________________
Private Sub send_rapport_til_fil_Click()
On Error GoTo Err_send_rapport_til_fil_Click
Dim stDocName As String
stDocName = "Klienter Query"
DoCmd.TransferText acExportDelim, , "Klienter Query", "report.txt", False
Exit_send_rapport_til_fil_Click:
Exit Sub
Err_send_rapport_til_fil_Click:
MsgBox Err.Description
Resume Exit_send_rapport_til_fil_Click
End Sub
__________________________________________________ ___________
I also have another button that prints out labels with names of the people in the DB. That button works, so only the names of the selected town will be printed. Maybe I can use something from that string? Anyway it looks like this:
__________________________________________________ ___________
Private Sub Command16_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Me.Refresh
stDocName = "Kuverter"
If param = 1 Then
stLinkCriteria = "[BibliotekID]=" & Me![BibliotekID]
Else
stLinkCriteria = "[BibliotekID]=" & Forms![Klienter Query]![BibliotekID]
End If
DoCmd.OpenReport stDocName, acNormal, , stLinkCriteria
'printes kun 1 gang
End Sub
__________________________________________________ ___________
I really hope someone can help me, I'm in trouble getting this to work.
Thanks in advance.
-Andreas