subforms problem
hello everyone,
i have a question which is silly but again i am not able to find any answer for it and i know you all have so please help
---------------------------------
autotec
id ->autonumber
and the rest
autotec_kia
id ->autonumber
and the rest
-------------------------------
access VER,2002
ok i have a form with some fields and a subform which will record a some other stuff for my form,normal up to here(form is justified design)which is working perfect
my second form is in datasheet view so i dont have enough space to put my subform here
here is my database
now i just created a button like this
Private Sub history_Click()
On Error GoTo Err_history_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "kia_subsheetdv"
stLinkCriteria = "[id]=" & Me![id]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_history_Click:
Exit Sub
Err_Command30_Click:
MsgBox "There is a problem",,,"Error"
Resume Exit_history_Click
End Sub
and this is my subform details
this is the record source
SELECT autotec_kia.id, autotec_kia.date, autotec_kia.buying, autotec_kia.selling FROM autotec_kia WHERE (((autotec_kia.id)=Forms!kia_sheet!ID));
ok here is the problem
when i click on the button i can see the history but when i am trying to add anything to it instead of adding it to the current record it will put it somewhere else
and thats it
can any one help
Best Regards,
Hamed Gholamian
|