Hi!
Two questions.
I have a form with a subform in it. The form basically allows us to track software on a specific machine. On the main form is a combo box with a list of applications. There are two command buttons: ADD and REMOVE. In the subform is the list of applications for the specific machine, plus some other minor details (dates, etc..).
1. When I click the ADD button, I would like for it to immediately add the application to a list in the subform. The subform is setup as a continuous form to show all applications. Right now, when I select an application, say Microsoft Office, and click ADD, it initially does nothing. I select a second application, say Adobe Photoshop, and click ADD and it adds Microsoft Office. So it's a step behind. I have the code: me.frmSubLoadset.Requery in my code, but it's delayed. Is there a way to have it populate the field on the subform immediately when clicking ADD?
2. Second, when I click the REMOVE button it should work the same as the ADD button, but just immediately remove the application from the subform...not just from the application field, but that entire record. Here is the code I have so far, but I don't think it's correct. I'm still pretty new at the coding side of Access:
Dim Application as String
Dim db as DAO.Database
Dim rsGroup as DAO.Recordset
Dim rsDel as DAO.Recordset
Application = Me![cboAppList]
Set db = CurrentDb
Set rsGroup = db.OpenRecordset("Select * from [tblSubLoadset] Where LoadsetLinkID =" & Me.LoadsetRecID)
Set rsDel = db.OpenRecordset("Select * from rsGroup Where AppName =" & Application)
rsDel.Delete
Me.frmSubLoadset.Requery
Any help on either of these is GREATLY appreciated.
Thanks much!
Elizabeth
Two questions.
I have a form with a subform in it. The form basically allows us to track software on a specific machine. On the main form is a combo box with a list of applications. There are two command buttons: ADD and REMOVE. In the subform is the list of applications for the specific machine, plus some other minor details (dates, etc..).
1. When I click the ADD button, I would like for it to immediately add the application to a list in the subform. The subform is setup as a continuous form to show all applications. Right now, when I select an application, say Microsoft Office, and click ADD, it initially does nothing. I select a second application, say Adobe Photoshop, and click ADD and it adds Microsoft Office. So it's a step behind. I have the code: me.frmSubLoadset.Requery in my code, but it's delayed. Is there a way to have it populate the field on the subform immediately when clicking ADD?
2. Second, when I click the REMOVE button it should work the same as the ADD button, but just immediately remove the application from the subform...not just from the application field, but that entire record. Here is the code I have so far, but I don't think it's correct. I'm still pretty new at the coding side of Access:
Dim Application as String
Dim db as DAO.Database
Dim rsGroup as DAO.Recordset
Dim rsDel as DAO.Recordset
Application = Me![cboAppList]
Set db = CurrentDb
Set rsGroup = db.OpenRecordset("Select * from [tblSubLoadset] Where LoadsetLinkID =" & Me.LoadsetRecID)
Set rsDel = db.OpenRecordset("Select * from rsGroup Where AppName =" & Application)
rsDel.Delete
Me.frmSubLoadset.Requery
Any help on either of these is GREATLY appreciated.
Thanks much!
Elizabeth