David, it still displays the first record

  • Thread starter Thread starter Antonio
  • Start date Start date
A

Antonio

David, it still displays the first record.

Thanks, Antonio
-------------------------------------
Antonio,
Why not have frmTroubleTicket as a sub-form of whatever
form CompanyName is
on (presumably OpenTTs). Maybe on a tab control.

If you must do it by opening a new form, here's an (Access
2000) example
that shows how to open the form with a where condition. Be
very careful how
many commas and quotation marks you use and where you put
them.
DoCmd.OpenForm "frmTroubleTicket", , ,"[YourTableName].
[CompanyName] = " &
"""" & Me.CompanyName & """"David Straker
Antonio said:
hello, all....I am trying to call another record from a
form to another form. This is what I have, but when I
double-click on the company name it doesn't show the
record for that customer, but it shows the first record in
the other form. Any help will be appreciated. Thanks

Private Sub CompanyName_DblClick(Cancel As Integer)

DoCmd.OpenForm "frmTroubleTicket", _
Wherecondition:="CompanyName = """ & Me.CompanyName
& """"

DoCmd.Close acForm, "OpenTTs"

End Sub


..
 
Antonio,
I almost missed your message - it posted itself as a new one and not a
continuation of your previous one (I had your old message flagged as
"watched").

I still think that subforms are the correct way to go - there's no code
involved at all - Access does it all for you. I've posted a zipped Access
2000 mdb at www.estraker.com. Click on "For Developers" and you'll see your
name at the bottom of the page. If you must use a separate form, can you
explain why and I'll post a different solution on my web site for you.

David Straker


Antonio said:
David, it still displays the first record.

Thanks, Antonio
-------------------------------------
Antonio,
Why not have frmTroubleTicket as a sub-form of whatever
form CompanyName is
on (presumably OpenTTs). Maybe on a tab control.

If you must do it by opening a new form, here's an (Access
2000) example
that shows how to open the form with a where condition. Be
very careful how
many commas and quotation marks you use and where you put
them.
DoCmd.OpenForm "frmTroubleTicket", , ,"[YourTableName].
[CompanyName] = " &
"""" & Me.CompanyName & """"David Straker
Antonio said:
hello, all....I am trying to call another record from a
form to another form. This is what I have, but when I
double-click on the company name it doesn't show the
record for that customer, but it shows the first record in
the other form. Any help will be appreciated. Thanks

Private Sub CompanyName_DblClick(Cancel As Integer)

DoCmd.OpenForm "frmTroubleTicket", _
Wherecondition:="CompanyName = """ & Me.CompanyName
& """"

DoCmd.Close acForm, "OpenTTs"

End Sub


.
 
Antonio,
I think I follow except for one thing. You say you have an Open Trouble
Tickets form that has a subform that displays the opened (still open?)
trouble tickets. What does the main part of the Open Trouble Tickets form
show if you need a subform to show open tickets - Customers with open
tickets? Without seeing your design, it's hard to give a simple answer but
I'll give it a try.

If you have a CustomerID combobox on the subform, the subform's combobox
double-click event procedure syntax to open the Customer form at the right
customer is:

DoCmd.OpenForm "Customers", , , "CustomerName = " & """" &
Me.CustomerID.Column(1) & """"

where the CustomerID combobox has 2 columns - one for the Autonum and the
other for the CustomerName from the Customer table. If your combobox/table
doesn't use autonums and you only have one column for it, replace Column(1)
with Column(0).

If you have a CustomerName textbox on the subform, the subform's
double-click event procedure syntax to open the Customer form at the right
customer is:

DoCmd.OpenForm "Customers", , , "CustomerName = " & """" &
Me.CustomerName & """"

If this doesn't solve the problem, I'd need to see your mdb before I could
help. A lot depends on how you set up the underlying tables and queries,
what controls you decided to use, etc. I'd be happy to look at it if you
want to email me a zipped copy. You should be able to figure out my real
email address from the munged one.

David Straker

Antonio said:
Ok, David...I will give you the whole picture....

I have a table (and form) for Customers, a table (and
form) for Trouble Tickets, and a Open Trouble tickets form
which contains a subform that displays the opened trouble
tickets.

The customer form is tabbed (6 tabs) with include subforms
for different information (customer's IP addresses, URLs,
etc.). When a customer calls in with a problem, there is
a button on the customers form that opens a new trouble
ticket.

In the trouble tickets form (single form, no tabs)
everything is recorded: customer info, date, product(s),
issue, and resolution.

If I am looking at a trouble ticket, I can double-click on
the companyname (in the trouble tickets form) and the
customers form opens displaying the full record for that
particular customer (filtered).

In the open trouble ticket form, the subform displays the
unresolved issues. There is where I am trying to put a
code that when double-clicking on the companyname, would
open the trouble tickets form and display the record for
that particular customer.

Hope it's clear and thank you for your time and advices.
Antonio
-----Original Message-----
Antonio,
I almost missed your message - it posted itself as a new one and not a
continuation of your previous one (I had your old message flagged as
"watched").

I still think that subforms are the correct way to go - there's no code
involved at all - Access does it all for you. I've posted a zipped Access
2000 mdb at www.estraker.com. Click on "For Developers" and you'll see your
name at the bottom of the page. If you must use a separate form, can you
explain why and I'll post a different solution on my web site for you.

David Straker


Antonio said:
David, it still displays the first record.

Thanks, Antonio
-------------------------------------
Antonio,
Why not have frmTroubleTicket as a sub-form of whatever
form CompanyName is
on (presumably OpenTTs). Maybe on a tab control.

If you must do it by opening a new form, here's an (Access
2000) example
that shows how to open the form with a where condition. Be
very careful how
many commas and quotation marks you use and where you put
them.
DoCmd.OpenForm "frmTroubleTicket", , ,"[YourTableName].
[CompanyName] = " &
"""" & Me.CompanyName & """"David Straker
hello, all....I am trying to call another record from a
form to another form. This is what I have, but when I
double-click on the company name it doesn't show the
record for that customer, but it shows the first record
in
the other form. Any help will be appreciated. Thanks

Private Sub CompanyName_DblClick(Cancel As Integer)

DoCmd.OpenForm "frmTroubleTicket", _
Wherecondition:="CompanyName = """ & Me.CompanyName
& """"

DoCmd.Close acForm, "OpenTTs"

End Sub
 
Sorry, David....the subform is a Datasheet (which should
be the same as double-clicking on a textbox, right?).

Antonio
-----Original Message-----
Antonio,
I think I follow except for one thing. You say you have an Open Trouble
Tickets form that has a subform that displays the opened (still open?)
trouble tickets. What does the main part of the Open Trouble Tickets form
show if you need a subform to show open tickets - Customers with open
tickets? Without seeing your design, it's hard to give a simple answer but
I'll give it a try.

If you have a CustomerID combobox on the subform, the subform's combobox
double-click event procedure syntax to open the Customer form at the right
customer is:

DoCmd.OpenForm "Customers", , , "CustomerName = " & """" &
Me.CustomerID.Column(1) & """"

where the CustomerID combobox has 2 columns - one for the Autonum and the
other for the CustomerName from the Customer table. If your combobox/table
doesn't use autonums and you only have one column for it, replace Column(1)
with Column(0).

If you have a CustomerName textbox on the subform, the subform's
double-click event procedure syntax to open the Customer form at the right
customer is:

DoCmd.OpenForm "Customers", , , "CustomerName = " & """" &
Me.CustomerName & """"

If this doesn't solve the problem, I'd need to see your mdb before I could
help. A lot depends on how you set up the underlying tables and queries,
what controls you decided to use, etc. I'd be happy to look at it if you
want to email me a zipped copy. You should be able to figure out my real
email address from the munged one.

David Straker

Ok, David...I will give you the whole picture....

I have a table (and form) for Customers, a table (and
form) for Trouble Tickets, and a Open Trouble tickets form
which contains a subform that displays the opened trouble
tickets.

The customer form is tabbed (6 tabs) with include subforms
for different information (customer's IP addresses, URLs,
etc.). When a customer calls in with a problem, there is
a button on the customers form that opens a new trouble
ticket.

In the trouble tickets form (single form, no tabs)
everything is recorded: customer info, date, product (s),
issue, and resolution.

If I am looking at a trouble ticket, I can double-click on
the companyname (in the trouble tickets form) and the
customers form opens displaying the full record for that
particular customer (filtered).

In the open trouble ticket form, the subform displays the
unresolved issues. There is where I am trying to put a
code that when double-clicking on the companyname, would
open the trouble tickets form and display the record for
that particular customer.

Hope it's clear and thank you for your time and advices.
Antonio
-----Original Message-----
Antonio,
I almost missed your message - it posted itself as a
new
one and not a
continuation of your previous one (I had your old
message
flagged as
"watched").

I still think that subforms are the correct way to go - there's no code
involved at all - Access does it all for you. I've
posted
a zipped Access
2000 mdb at www.estraker.com. Click on "For Developers" and you'll see your
name at the bottom of the page. If you must use a separate form, can you
explain why and I'll post a different solution on my
web
site for you.
David Straker


David, it still displays the first record.

Thanks, Antonio
-------------------------------------
Antonio,
Why not have frmTroubleTicket as a sub-form of whatever
form CompanyName is
on (presumably OpenTTs). Maybe on a tab control.

If you must do it by opening a new form, here's an (Access
2000) example
that shows how to open the form with a where
condition.
Be
very careful how
many commas and quotation marks you use and where you put
them.
DoCmd.OpenForm "frmTroubleTicket", , ,"[YourTableName].
[CompanyName] = " &
"""" & Me.CompanyName & """"David Straker
hello, all....I am trying to call another record
from
a
form to another form. This is what I have, but when I
double-click on the company name it doesn't show the
record for that customer, but it shows the first record
in
the other form. Any help will be appreciated. Thanks

Private Sub CompanyName_DblClick(Cancel As Integer)

DoCmd.OpenForm "frmTroubleTicket", _
Wherecondition:="CompanyName = """ & Me.CompanyName
& """"

DoCmd.Close acForm, "OpenTTs"

End Sub


.
 
Antonio,

Nope, not necessarily. It depends on what the control is on your subform for
the Customer field. Theoretically you could be using a text box or a
combobox (or even a list box, listview, treeview or any other kind of
selector). If the control is a combobox or a textbox, the syntax given in my
previous reply still applies.

If this doesn't help, I'd have to see the mdb. I'm thrashing around in the
dark here.

David Straker


Antonio said:
Sorry, David....the subform is a Datasheet (which should
be the same as double-clicking on a textbox, right?).

Antonio
-----Original Message-----
Antonio,
I think I follow except for one thing. You say you have an Open Trouble
Tickets form that has a subform that displays the opened (still open?)
trouble tickets. What does the main part of the Open Trouble Tickets form
show if you need a subform to show open tickets - Customers with open
tickets? Without seeing your design, it's hard to give a simple answer but
I'll give it a try.

If you have a CustomerID combobox on the subform, the subform's combobox
double-click event procedure syntax to open the Customer form at the right
customer is:

DoCmd.OpenForm "Customers", , , "CustomerName = " & """" &
Me.CustomerID.Column(1) & """"

where the CustomerID combobox has 2 columns - one for the Autonum and the
other for the CustomerName from the Customer table. If your combobox/table
doesn't use autonums and you only have one column for it, replace Column(1)
with Column(0).

If you have a CustomerName textbox on the subform, the subform's
double-click event procedure syntax to open the Customer form at the right
customer is:

DoCmd.OpenForm "Customers", , , "CustomerName = " & """" &
Me.CustomerName & """"

If this doesn't solve the problem, I'd need to see your mdb before I could
help. A lot depends on how you set up the underlying tables and queries,
what controls you decided to use, etc. I'd be happy to look at it if you
want to email me a zipped copy. You should be able to figure out my real
email address from the munged one.

David Straker

Ok, David...I will give you the whole picture....

I have a table (and form) for Customers, a table (and
form) for Trouble Tickets, and a Open Trouble tickets form
which contains a subform that displays the opened trouble
tickets.

The customer form is tabbed (6 tabs) with include subforms
for different information (customer's IP addresses, URLs,
etc.). When a customer calls in with a problem, there is
a button on the customers form that opens a new trouble
ticket.

In the trouble tickets form (single form, no tabs)
everything is recorded: customer info, date, product (s),
issue, and resolution.

If I am looking at a trouble ticket, I can double-click on
the companyname (in the trouble tickets form) and the
customers form opens displaying the full record for that
particular customer (filtered).

In the open trouble ticket form, the subform displays the
unresolved issues. There is where I am trying to put a
code that when double-clicking on the companyname, would
open the trouble tickets form and display the record for
that particular customer.

Hope it's clear and thank you for your time and advices.
Antonio
-----Original Message-----
Antonio,
I almost missed your message - it posted itself as a new
one and not a
continuation of your previous one (I had your old message
flagged as
"watched").

I still think that subforms are the correct way to go -
there's no code
involved at all - Access does it all for you. I've posted
a zipped Access
2000 mdb at www.estraker.com. Click on "For Developers"
and you'll see your
name at the bottom of the page. If you must use a
separate form, can you
explain why and I'll post a different solution on my web
site for you.

David Straker


David, it still displays the first record.

Thanks, Antonio
-------------------------------------
Antonio,
Why not have frmTroubleTicket as a sub-form of whatever
form CompanyName is
on (presumably OpenTTs). Maybe on a tab control.

If you must do it by opening a new form, here's an
(Access
2000) example
that shows how to open the form with a where condition.
Be
very careful how
many commas and quotation marks you use and where you
put
them.
DoCmd.OpenForm "frmTroubleTicket", , ,"[YourTableName].
[CompanyName] = " &
"""" & Me.CompanyName & """"David Straker
hello, all....I am trying to call another record from
a
form to another form. This is what I have, but when I
double-click on the company name it doesn't show the
record for that customer, but it shows the first
record
in
the other form. Any help will be appreciated. Thanks

Private Sub CompanyName_DblClick(Cancel As Integer)

DoCmd.OpenForm "frmTroubleTicket", _
Wherecondition:="CompanyName = """ &
Me.CompanyName
& """"

DoCmd.Close acForm, "OpenTTs"

End Sub


.
 
Back
Top