Hello All,
I would like to start by recognizing the knowledge on this forum. I see some major potential for learning here.
Like I just read from someone, better than going to a class and learning from a book and probably not getting as much out of it.
Again, thanks to all for your responses.
Ok, here we go.
I am reinventing the wheel here. Have made a Licensing database to track our software licenses and am not real quick with the VB code in some areas.
Probably don't need to do it in code in some areas but Access is not my strong point, was weened from dBase and Paradox several years ago.
I have an issue with updating the parent when the child has been adjusted.
The scenario:
Add info to child to choose SomeSoftware, this updates the parent showing that piece of software has been issued or one or more of that piece of software has been issued.
I have it updating the parent for this, I have it deleting ONE piece of software from the child and updating the parent, like so:
delqry = "DELETE [License User].AssetNum, [License User].IDNum," & _
"[License User].SoftUserID, [License User].DateIssued" & _
" FROM [License User]" & _
" WHERE ((([License User].SoftUserID)=[RecDel]))"
issqry = "UPDATE UserAssignLicQry SET UserAssignLicQry.Issued = [issued]-1" & _
" WHERE (((UserAssignLicQry.SoftUserID)=[recdel]))"
Set Mydb = CurrentDb
Set Myrst = Mydb.OpenRecordset(sqlstr)
Set rstTemp = Mydb.OpenRecordset("UserAssignLicQry"
Set subform = Form_Form_SUB_UserAssignLicQry
tagno = subform.AssetNum.Value
Recdel = tagno & InputBox("Enter the software id to delete." & vbCr & _
" i.e. 10" & vbCr & _
"Where 10 is the Software ID", "Software Deletion Confirmation"
DoCmd.SetWarnings False
DoCmd.RunSQL issqry
DoCmd.RunSQL delqry
Recdel = ""
DoCmd.SetWarnings True
It runs nicely and will do exactly what I want. If any of you have a better suggestion for this code, I will be more than willing to listen/read.
The problem is when I have to delete multiple entries based on the same assetnum.
Can't seem to get it quite right. Can delete all of the records related to the asset in the child with the delete qry, but can't get the update to update but one of the entries in the parent. It is just supposed to add one to the [issued] field.
Any suggestions will be greatly, immensely in appreciation.
rnpIII
I would like to start by recognizing the knowledge on this forum. I see some major potential for learning here.
Like I just read from someone, better than going to a class and learning from a book and probably not getting as much out of it.
Again, thanks to all for your responses.
Ok, here we go.
I am reinventing the wheel here. Have made a Licensing database to track our software licenses and am not real quick with the VB code in some areas.
Probably don't need to do it in code in some areas but Access is not my strong point, was weened from dBase and Paradox several years ago.
I have an issue with updating the parent when the child has been adjusted.
The scenario:
Add info to child to choose SomeSoftware, this updates the parent showing that piece of software has been issued or one or more of that piece of software has been issued.
I have it updating the parent for this, I have it deleting ONE piece of software from the child and updating the parent, like so:
delqry = "DELETE [License User].AssetNum, [License User].IDNum," & _
"[License User].SoftUserID, [License User].DateIssued" & _
" FROM [License User]" & _
" WHERE ((([License User].SoftUserID)=[RecDel]))"
issqry = "UPDATE UserAssignLicQry SET UserAssignLicQry.Issued = [issued]-1" & _
" WHERE (((UserAssignLicQry.SoftUserID)=[recdel]))"
Set Mydb = CurrentDb
Set Myrst = Mydb.OpenRecordset(sqlstr)
Set rstTemp = Mydb.OpenRecordset("UserAssignLicQry"
Set subform = Form_Form_SUB_UserAssignLicQry
tagno = subform.AssetNum.Value
Recdel = tagno & InputBox("Enter the software id to delete." & vbCr & _
" i.e. 10" & vbCr & _
"Where 10 is the Software ID", "Software Deletion Confirmation"
DoCmd.SetWarnings False
DoCmd.RunSQL issqry
DoCmd.RunSQL delqry
Recdel = ""
DoCmd.SetWarnings True
It runs nicely and will do exactly what I want. If any of you have a better suggestion for this code, I will be more than willing to listen/read.
The problem is when I have to delete multiple entries based on the same assetnum.
Can't seem to get it quite right. Can delete all of the records related to the asset in the child with the delete qry, but can't get the update to update but one of the entries in the parent. It is just supposed to add one to the [issued] field.
Any suggestions will be greatly, immensely in appreciation.
rnpIII