Populate a Form from Existing Data

Hiten

Registered User.
Local time
Today, 09:50
Joined
Sep 17, 2001
Messages
51
Hi
I cant get my head around this one,

I have a Form that enters all details for an Order.

On that form is a Tick Box that says Repeatable.

If that box is ticked in the future I am able to repeat on that stock item.

I have created a form with a List boxea that Lists all Suppliers Stock that is Repeatable

I want to be able to double click a Stock Item from that list, then let it populate another Order ( Unique Key ), fill in all the field from the previous order, so all I have to do is enter the Quantity I want to re-order.

How do I do this?

please help

Hightower
 
idea

hey,

If you create a temporary table containing all the fields from your order table used on your form, you can then create a macro containing the following:

1. delete query - to remove all data in the temporary table
2. append query - select all fields in your order table where the unique key in the table = the unique key in your form (you should then have a copy of your order in the temporary table)
3. another append query to copy the data from your temporary table (minus the unique key) into your order table
4. apply filter on your form to show the last record (obviously this depends on whether you have a sort on your orders by something other than the unique key)

hope this helps :)
 
Thanks

Thanks Mate, will give it a go, sounds about right
 
Bit of a problem

Hi Mate

Bit lost on this.

I have a Query [qry_ListSearch] that lists everything in the [tbl_ZM_Orders] which has a yes/no field with items that can be repeated on.

From this list, I have a search form that lets me select from Supplier and Product and list of lines that can be repeated on ( from [qry_ListSearch] )

I think what you are saying is;

i want to be able to double click on a product from that list, which has the unique keys as [Barcode_Dept] and [Barcode_Style]

Then append the selected one to a temp table

then append it to the actual table and generate a new order but with that data on there, and the fill in qty and other details that would be differant

does this sound correct?

the code i am using to try and pick the unique barcode from the list is

Private Sub SearchList_DblClick(Cancel As Integer)

Dim stDocName As String
Dim stlinkcriteria As String

stDocName = "qry_Repeat_Append_Temp"

stlinkcriteria = "[ProductCode]=" & Me![SearchList]

DoCmd.OpenQuery stDocName, , , stlinkcriteria

Exit_SearchList_Dblclick:
Exit Sub

Err_SearchList_Dblclick:
MsgBox Err.description
Resume Exit_SearchList_Dblclick

End Sub

but i am having problems getting the unique item

PLEASE HELP
 
driving me insane

hiya,

I have set up a query with a condition [Barcode_Dept]

so when i double click on my list box it should pass through the value to this condition

it doesnt, i am not very good at code so probably messed it up please can you point me in the right direction

Private Sub SearchList_DblClick(Cancel As Integer)

Dim stDocName As String
Dim stlinkcriteria As String

stDocName = "qry_Repeat_Append_Temp"
DoCmd.OpenQuery stDocName
Barcode_Dept = Form_frm_Search_Repeatable!SearchList

Exit_SearchList_Dblclick:
Exit Sub

Err_SearchList_Dblclick:
MsgBox Err.description
Resume Exit_SearchList_Dblclick

End Sub
 

Users who are viewing this thread

Back
Top Bottom