borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2009 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Data Objects that are used as an interface to Databases)Next Topic (Dynamic Footers in Access Reports) New Topic New Poll Post Reply
AndreaVB Forum : Database : Access 2002 VB problem...
Poster Message
chief_wpd
Level: Guest


icon Access 2002 VB problem...  Archived to Disk

i am using the following code to open a listbox that allows me to select a person from the 'master name' file, and then place that persons ID into a different form that is based on the 'master name' file.  

I want to modify so that I can search for the person, select them from the listbox list, and then have just their 'person ID' field information put into a different form which is not based on the 'master name' form.  The 'person ID' is used to link the new form to the 'master name' file.

Is there a way to do this without having to have the 'master name' form open?

Here is the code:

Option Compare Database

Private Sub LIst8_AfterUpdate()
    ShowRecord.Enabled = True
End Sub

Private Sub List8_DblClick(Cancel As Integer)
    If Not IsNull(List0) Then
        ShowRecord_Click
    End If
End Sub

Private Sub ShowRecord_Click()
    Dim rst As DAO.Recordset
    Set rst = Forms![Master Name].RecordsetClone
    Forms!WarningsTickets!txtPerson_ID.Value = rst.Fields("Person_ID") & Me.List8
    DoCmd.close acForm, "GotoRecordDialog8"
End Sub
Private Sub cancel_actioni_Click()
On Error GoTo Err_cancel_actioni_Click


    DoCmd.close

Exit_cancel_actioni_Click:
    Exit Sub

But with this code I am forced to have the 'master name' form open.  Which is a hassle in the simple running of the database operations by a user.

Thanks for any fixes you can come up with.

MAC

11-04-2002 at 03:39 AM
| Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1658
icon Re: Access 2002 VB problem...  Archived to Disk

Offhand, you could try storing the variables, and other information that you need from the first form into: 1) a table, 2) variables. (ie. table name to open, ID of person, et cetera)

Then in the next form, you can just access the new table (or variables) and use them, instead of the references to the master form.

Although, you could possibly just hide the master form, then make it visible again when needed - leaving the code as is otherwise.


11-04-2002 at 04:47 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
king910
Level: Guest

icon Re: Access 2002 VB problem...  Archived to Disk

quote:
chief_wpd wrote:
i am using the following code to open a listbox that allows me to select a person from the 'master name' file, and then place that persons ID into a different form that is based on the 'master name' file.  

I want to modify so that I can search for the person, select them from the listbox list, and then have just their 'person ID' field information put into a different form which is not based on the 'master name' form.  The 'person ID' is used to link the new form to the 'master name' file.

Is there a way to do this without having to have the 'master name' form open?

Here is the code:

Option Compare Database

Private Sub LIst8_AfterUpdate()
    ShowRecord.Enabled = True
End Sub

Private Sub List8_DblClick(Cancel As Integer)
    If Not IsNull(List0) Then
        ShowRecord_Click
    End If
End Sub

Private Sub ShowRecord_Click()
    Dim rst As DAO.Recordset
    Set rst = Forms![Master Name].RecordsetClone
    Forms!WarningsTickets!txtPerson_ID.Value = rst.Fields("Person_ID") & Me.List8
    DoCmd.close acForm, "GotoRecordDialog8"
End Sub
Private Sub cancel_actioni_Click()
On Error GoTo Err_cancel_actioni_Click


    DoCmd.close

Exit_cancel_actioni_Click:
    Exit Sub

But with this code I am forced to have the 'master name' form open.  Which is a hassle in the simple running of the database operations by a user.

Thanks for any fixes you can come up with.

MAC

---
If your problem is still open then please eleborate me on the above. What exactly you are trying to do?

Sunil
22-04-2002 at 08:42 AM
| Quote Reply
AndreaVB Forum : Database : Access 2002 VB problem...
Previous Topic (Data Objects that are used as an interface to Databases)Next Topic (Dynamic Footers in Access Reports) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2009 Andrea Tincaniborder