Chat with a LIVE Microsoft Access Expert!
 
       
 

         

   

Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
 
Chat with a LIVE Microsoft Access Expert!
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-16-2006, 04:51 AM
nat22 nat22 is offline
Registered User
 
Join Date: Jan 2006
Posts: 16
nat22 is on a distinguished road
Selecting records

Hello everyone,
I am new one in Access programing so I will be grateful if someone can help me.The situation is this:I have main form frmOdabirOpreme.With button cmdNapajanje I open a new form frmNapajanje.On this form I have listBox lstNapajanje in which RowSource I have put - SELECT Napajanje.Referenca, Napajanje.Opis FROM Napajanje;(it is from Table Napajanje and it has two fields -Referenca and Opis). On this lstNapajanje I can see few records from Table Napajanje which I do not change.Now I want to select one of these records (by DoubleClick event on lstNpajanje) and copy it to another Table OdabranaOprema (which is connected to Excel file as invoice).
What is the best way to do this?

thanks,

I have tried something like this!

Private Sub lstNapajanje_DblClick(Cancel As Integer)


Dim db As Database
Dim strSQL As String

'create SQL to append records
strSQL = "INSERT INTO OdabranaOprema (Referenca, Opis ) " _
& " SELECT " & Referenca & ", Opis " _
& " FROM Napajanje " _
& " ORDER BY Referenca;"
'run the SQL statement
CurrentDb.Execute strSQL
'refresh the table definitions with records added by other persons/processes
CurrentDb.TableDefs.Refresh
'wake-up call for Access
DoEvents
'requery the subform



Set rsOdabranaOprema = Nothing

End Sub
Reply With Quote
Sponsored Links
Sponsored Links
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting records and updating those selectedrecords RHouse General 0 10-13-2005 03:09 AM
Selecting record's column in subform kappa Forms 4 05-29-2005 06:15 AM
excluding records Tim L Queries 3 10-22-2003 11:44 AM
Selecting the last 5 records whitespaces Queries 2 07-30-2002 09:18 PM
Selecting all records in select Query on a subform sush Forms 0 09-26-2001 10:49 AM


All times are GMT -8. The time now is 04:47 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) copyright 2009 Access World