FindRecord problem

M

Mick

Hi All

Have two forms, stock and order. When the user selects from a Lookup
wizard StockID (based on a field in Stock table) I need it to open
Stock table at right record so ammendments can be made.

Code is:
Private Sub StockID_Exit(Cancel As Integer)
'this stock ID is on the order form
Dim findstocknumber As Long


StockID = findstocknumber
DoCmd.OpenForm "frmStock"
StockID.SetFocus
DoCmd.FindRecord findstocknumber

Forms![frmOrder].SetFocus
End Sub

When I use an entry from Stock ID such as "crisps" as the argument for
DoCmd.FindRecord it works fine, but can't use the variable
findstocknumber instead.

Can't believe I'm stuck on such a simple thing, but there you go.

Any help appreciated

Mick
 
G

Guest

I cant see in your code where you assign a value to the findstocknumber
variable, so on what value do you want to search on?
 
M

Mick

Hi Ofer

Was trying to use the drop down on Order as findstocknumber but am
beginning to think the problem is in a lookup wizard that I used from
Stock that brought the PK with it - think it is searching for that.

Thanks a lot for the help

Mick
 

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

Similar Threads

FindRecord Error 2
Help with FindRecord 1
FindRecord problem 1
FindRecord Code problem 1
NotInList Error Problem 3
Finding a Specific record problem 2
Lookup value from another table ado. 3
Autofill ID fields 6

Top