| Chat with a LIVE Microsoft
Access Expert! |
||||
|
||||
|
#1
|
|||
|
|||
|
Hello everyone,
This is code with which I choose records from one table and I put them to another table (OdabranaOprema), can I add code with which I can stop choosing the same record twice? I would like in that case have possibility to change the quantity of the record which is selected twice, thanks Private Sub cmdOdaberi_Click() On Error GoTo Handler Dim strRedak As String Dim strOdabranaReferenca As String Dim rsPonudjenaOprema As Recordset Dim rsOdabranaOprema As Recordset Dim db As Database Dim intRedak As Integer Dim strSQL As String Dim strSQLOdabir As String txtNapajanje.SetFocus Set db = CurrentDb strSQL = " SELECT Napajanje.Referenca As Referenca, Napajanje.Opis as Opis, Napajanje.Visina " & _ " FROM Napajanje " & _ " WHERE (((Napajanje.PickFlag)= True))" strSQLOdabir = "Select OdabranaOprema.Referenca, OdabranaOprema.Opis, OdabranaOprema.Kolicina, OdabranaOPrema.Visina " & _ "From OdabranaOprema" Set rsPonudjenaOprema = db.OpenRecordset(strSQL, dbOpenSnapshot, dbReadOnly) Set rsOdabranaOprema = db.OpenRecordset(strSQLOdabir) Do Until rsPonudjenaOprema.EOF txtNapajanje.SetFocus rsOdabranaOprema.AddNew rsOdabranaOprema.Fields("Referenca").Value = rsPonudjenaOprema.Fields("Referenca").Value rsOdabranaOprema.Fields("Opis").Value = rsPonudjenaOprema.Fields("Opis").Value rsOdabranaOprema.Fields("Visina").Value = rsPonudjenaOprema.Fields("Visina").Value rsOdabranaOprema.Fields("Kolicina").Value = txtNapajanje.Value rsPonudjenaOprema.MoveNext rsOdabranaOprema.Update Loop Set rsPonudjenaOprema = Nothing Set rsOdabranaOprema = Nothing Set db = Nothing Handler: Izlaz: End Sub |
| Sponsored Links |
|
#2
|
||||
|
||||
|
RE: Check for duplicates
You could use the unmatched or duplicate wizard
from the database window (objects) select queries then new and use one of the above wizards
__________________
Hope this Helps 'To the world you might be one person,but to one person you just might be the world' Smart |
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Check Box and Combo Box Blank | ErikRP | Forms | 9 | 03-25-2008 12:09 PM |
| Checkbox filter query | _rob_ | Forms | 15 | 06-03-2005 12:13 AM |
| Assigning Check Numbers in an Update Query | ccmis | Queries | 1 | 04-16-2002 03:47 PM |
| Check Boxes | Russ | Forms | 1 | 01-26-2000 08:32 PM |