need help with the save & open command
have the following code

Private Sub Command1_Click()

CommonDialog1.Filter = "*.dat"
CommonDialog1.FilterIndex = 0
CommonDialog1.FileName = CommonDialog1.Filter
CommonDialog1.ShowSave

If CommonDialog1.FileName = "" Then Exit Sub
If InStr(CommonDialog1.FileName, "*") <> 0 Then Exit Sub

z$ = CommonDialog1.FileName
If InStrRev(z$, ".") = 0 Then z$ = z$ + ".dat"

If Dir(z$, vbArchive) <> "" Then
r = MsgBox("This file existe. Erase old data???", vbCritical Or vbYesNo, "File Existe")
If r <> 6 Then Exit Sub
End If

Close
Open z$ For Output As #1
For a = 1 To 6
Print #1, lblanswer(a)
Next
For a = 1 To 12
Print #1, txtdata(a)
Next
Close


please help