help with click

I

ifoundgoldbug

I have an action item datasheet with current work orders on it. When a
work order is clicked on i would like it to open up the work orders
form to the work order number that was clicked on. I have gotten the
work order number into a variable and the work order form open but I
can't get it to go to the proper record.

here is the code that I have thus far.

Private Sub Work_Order___DblClick(Cancel As Integer)

Dim wo As String

wo = [Form_action item].Work_Order__.Value

DoCmd.OpenForm "work order"

DoCmd.GoToRecord acDataForm, "Work Order", acGoTo, wo

End Sub


thank you for your time

Gold Bug
 
J

jahoobob via AccessMonster.com

Assuming that wo is the key field in the work orders on the work order form
and work_order_value is a field in the action item form, try this code:
Private Sub Work_Order___DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "work order"

stLinkCriteria = "[wo]=" & Me![work_order_value]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub

I have an action item datasheet with current work orders on it. When a
work order is clicked on i would like it to open up the work orders
form to the work order number that was clicked on. I have gotten the
work order number into a variable and the work order form open but I
can't get it to go to the proper record.

here is the code that I have thus far.

Private Sub Work_Order___DblClick(Cancel As Integer)

Dim wo As String

wo = [Form_action item].Work_Order__.Value

DoCmd.OpenForm "work order"

DoCmd.GoToRecord acDataForm, "Work Order", acGoTo, wo

End Sub

thank you for your time

Gold Bug
 
I

ifoundgoldbug

Here is the code that I have currently and it opens up the proper form
but does not go to the proper record for some reason.

Private Sub Work_Order___DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "work order"

stLinkCriteria = [Form_action item].Work_Order__.Value
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub

any ideas???

Gold bug

Assuming that wo is the key field in the work orders on the work order form
and work_order_value is a field in the action item form, try this code:
Private Sub Work_Order___DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "work order"

stLinkCriteria = "[wo]=" & Me![work_order_value]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub

I have an action item datasheet with current work orders on it. When a
work order is clicked on i would like it to open up the work orders
form to the work order number that was clicked on. I have gotten the
work order number into a variable and the work order form open but I
can't get it to go to the proper record.

here is the code that I have thus far.

Private Sub Work_Order___DblClick(Cancel As Integer)

Dim wo As String

wo = [Form_action item].Work_Order__.Value

DoCmd.OpenForm "work order"

DoCmd.GoToRecord acDataForm, "Work Order", acGoTo, wo

End Sub

thank you for your time

Gold Bug
 
I

ifoundgoldbug

Update:

Private Sub Work_Order___DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "work order"

stLinkCriteria = [Form_action item].Work_Order__.Value
DoCmd.OpenForm stDocName, , , "[work order #] = stLinkCriteria"
End Sub

I have gotten it to quasi work. when it hit the open form it pops up a
stlinkcriteria window asking for parameters and if you put in the work
order number it will work. but for some unknown reason it will not hold
the W/O number in stlinkcriteria. any ideas?

thank you for your time

Gold Bug
Here is the code that I have currently and it opens up the proper form
but does not go to the proper record for some reason.

Private Sub Work_Order___DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "work order"

stLinkCriteria = [Form_action item].Work_Order__.Value
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub

any ideas???

Gold bug

Assuming that wo is the key field in the work orders on the work order form
and work_order_value is a field in the action item form, try this code:
Private Sub Work_Order___DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "work order"

stLinkCriteria = "[wo]=" & Me![work_order_value]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub

I have an action item datasheet with current work orders on it. When a
work order is clicked on i would like it to open up the work orders
form to the work order number that was clicked on. I have gotten the
work order number into a variable and the work order form open but I
can't get it to go to the proper record.

here is the code that I have thus far.

Private Sub Work_Order___DblClick(Cancel As Integer)

Dim wo As String

wo = [Form_action item].Work_Order__.Value

DoCmd.OpenForm "work order"

DoCmd.GoToRecord acDataForm, "Work Order", acGoTo, wo

End Sub

thank you for your time

Gold Bug
 
D

Dirk Goldgar

Update:

Private Sub Work_Order___DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "work order"

stLinkCriteria = [Form_action item].Work_Order__.Value
DoCmd.OpenForm stDocName, , , "[work order #] = stLinkCriteria"
End Sub

I have gotten it to quasi work. when it hit the open form it pops up a
stlinkcriteria window asking for parameters and if you put in the work
order number it will work. but for some unknown reason it will not
hold the W/O number in stlinkcriteria. any ideas?

Make that last line of the sub:

DoCmd.OpenForm stDocName, , , "[work order #] = " & stLinkCriteria"

If that works, you may want to clean up your code by revising the
preceding line to this:

stLinkCriteria = Me![Work Order #].Value

If I've correctly figured out what you're doing, that would be a cleaner
and more efficient way of coding it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top