Pls help, i need to make this program work asap.

homer.favenir

Registered User.
Local time
Today, 04:02
Joined
Aug 6, 2007
Messages
58
i input records in this form into DL Files.tbl, the records will appear in list box DL Files. I made LV.tbl and LV list box and put the LV list box in this form
i want to move the records in DL Files list box to LV list box.
how can i do it?

pls see image below.
269536288


:confused::confused:
 
If they're just List boxes then transferring the contents of one to the other shouldn't be that hard.

Try something like this

Code:
Dim i as Integer
i = 0
Do until i = list.ListCount
 List2.AddItem (List.ItemData(i))
 i = i + 1
Loop

List and List2 you need to replace with the names of your two lists.

I haven't tested this code at all but hopefully it'll work :) You may need to set i = 1 but not certain
 
thank you very much agehoops,but i forgot, i have to move records from table to another table.
e.g.: if im finish with the records in table 1 then i have to move it to table 2. to make the records in table 1 and table 2 appear in my form, i have to make a list box for both tables. then a command button to transfer the records.

pls help

thanks
 
ah ok. Well assuming the two tables have got the same fields then just create an append query to copy the data from the one table to another, then a delete query to remove that record if you need to. Then make the query run when you click the button
 
thanks!!! what's the query? can i just send you the db then edit it, just a minimal adjustment. please!!!

thanks
 
Yea course you can. Give me all the details of what table you want the record copying and to where. Do you want it just copied? Or deleted as well?
 
Yea course you can. Give me all the details of what table you want the record copying and to where. Do you want it just copied? Or deleted as well?

thank you very much agehoops,
attached file is my db.
just the command button that will transfer records from DL.tbl to LV.tbl

thanks a lot again.

:o:o
 
thank you very much agehoops,
attached file is my db.
just the command button that will transfer records from DL.tbl to LV.tbl

thanks a lot again.

:o:o

agehoops, please check attached file, maybe you can do some minimal adjustments here to work...
thank you very much...

homer from manila
 
There is no attatched file???? Get it on, i'll take a look at some point. Gotta go to a friends house now and sort out some problems then i'll take a look this evening.
 
There is no attatched file???? Get it on, i'll take a look at some point. Gotta go to a friends house now and sort out some problems then i'll take a look this evening.

why can't i attached files here?
anyway ill try again.

thanks
 

Attachments

oh yea, do you want it to transfer all the records, or just the record that is being looked at at the time?
 
Ok another couple of questions. Is the list box on the right, the LV one supposed to list the records in the LV table or just values you specify? Also do you want to be able to copy them in reverse? IE. from LV to DL? And do you want there to be a warning? Or request for user input?
 
thanks agehoops for replying,
The LV list box will get the records from LV table, and yes i want to copy them in reverse, if i make a mistake i can put it back again. warning and a request for user input will be a great idea.

thank you very much.

homer
 
When you say if you make a mistake and want to reverse it, does that mean that when you move it back you want it to delete the record? Or are you just wanting to clone the record each time you copy it from one table to another?

so just copying when transferring between both tables? Or copying and deleting?
 
i just want to copy and delete from source, or should i say i just want to move the record.
the db ive sent you is not yet done, i have more forms to make, just like the table.
if the transfer button will work can i just copy paste and edit it into a new form?


thanks.
 
Heya. I've got it working to what I think you were after.

Ok. When you click the transfer button, it checks to see if you've actually selected a record from the list box. If you haven't, it'll pop up a message box, stating that no record was chosen. If one was selected it will continue.

A message box will open, asking the user if they're sure they want to move the record. Yes or no. If no, it doesn't do anything. If Yes, then the record that was selected, is moved into the other table, and deleted from that table. This works both ways.

Now to recreate this for the other forms isn't hard, but it's not going to be as simple as copy and pasting the buttons. That will literally only copy the buttons, not the code itself, which is what is doing all the work.

If you look at the code that is running on each of the two buttons, it shouldn't be TOO hard to figure out the various things. where it says LV it means the list box for LV, and DL means the list box for DL. Just change these to the name of whatever list box applies. in the SQL you will also need to change the name of the table the data is going into, and ensure all the field names are accurate and correct. You'll then need to create a Delete query to delete the data once it's copied. There are 2 there already so you can see what they're like. For the Delete query, you need to specify a criteria of what to delete...

On the form, you'll notice 2 new fields. DON'T delete these otherwise it won't work. They hold the ID number for the record that has been selected (they're not visible when you run the form normally) These boxes are the criteria of the delete query. To set it, look at the delete queries that are there. They should show you how to do it.

Hope all this makes sense. If you do get stuck, just send me a PM and i'll help you out.

Hope it is what you were after :)

Aidy

View attachment tracker.zip
 
yes!!!
thanks so many agehoops, im always thinking what to do with the codes for almost 1 week. and even before i sleep it always goes into my mind. i want to impress my manager with this db. we are having hard time tracing the reports we are doing and i think it will be a good idea having this db.

ill pm you if i have still a questions.

anyways.
many thanks to you again.
homer
 

Users who are viewing this thread

Back
Top Bottom