creating multiple copies of sales order forms (1 Viewer)

accessonly11

Member
Local time
Today, 07:08
Joined
Aug 20, 2022
Messages
91
dear all,

i want to create multiple copies of sales order form with its subform, as like in we create new page in word by pressing Ctrl+N(new) key, or in excell we get new workbook,
i hope, i describe my point correctly
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 19:08
Joined
Oct 29, 2018
Messages
21,498
You can right click on the nav pane and use copy and paste.
 

ahmedjamalaboelez

Ahmed J. Aboelez
Local time
Yesterday, 19:08
Joined
Feb 25, 2015
Messages
79

Eugene-LS

Registered User.
Local time
Today, 05:08
Joined
Dec 7, 2018
Messages
481
i hope, i describe my point correctly
I think = Yes.
I solved a similar problem this way:
Code:
Private Sub cmdDuplicateRecord_Click()
'Дублирование записи формы + Копирование записей из её подчинённой формы
'Duplicatie van records van het huidige formulier samen met de gegevens van de ondergeschikte
'Duplicate form entry + Copy entries from its SubForm
'----------------------------------------------------------------
Dim i As Integer, n As Integer, v() As Variant
Dim lRecID As Long, lRecIDNew As Long
Dim strSQL As String
Const sIDFieldName$ = "ID" 'Название поля кода записи - sleutel veld naam - RecordID field name
 
On Error GoTo cmdDuplicateRecord_Click_Err
    
    Me.Dirty = False 'Сохранка! - huidige record opslaan - Saving the current form entry
    
    n = Me.Recordset.Fields.Count - 1 'кол-во полей = Размерность массива - Matrix dimensie - Number of fields = Array size
    ReDim v(n)
    
    For i = 0 To n                    'Текущие значения полей в массив - Put the current field values into an array
        v(i) = Me.Recordset.Fields(i).Value
    Next i
    
    If IsNull(Me(sIDFieldName).Value) Then
        'Nieuw item - Geen duplicatie! - New entry - Can't duplicate!
        MsgBox "Запись новая - Нельзя дублироваить!", vbExclamation
        GoTo cmdDuplicateRecord_Click_End
    End If
    'Remember the ID of the old record - to insert subordinate ...
    lRecID = Me(sIDFieldName).Value 'Запоминаем ID старой записи - для вставки подчинённых ...
    
'Добаление новой записи - Een nieuw record toevoegen :
    Me.Recordset.AddNew 'На новую запись - ga naar een nieuw record
    For i = 0 To n  'Старые значения из массива переносим в поля новой записи (кроме ID)
        If Not Me.Recordset.Fields(i).Name = sIDFieldName Then
            If Not IsEmpty(v(i)) Then Me.Recordset.Fields(i).Value = v(i)
        End If
    Next i
    Me.Recordset.Update 'Сохранение созданой записи - _
        Als u het gemaakte record opslaat, moet u ondergeschikten toevoegen
        Saving the record you just created
    
    lRecIDNew = Me(sIDFieldName).Value 'ID новой записи - для вставки подчинённых _
        Nieuw record-ID - om ondergeschikten in te voegen  ...
    
'Копируем подчинённые записи  - запросом на добавление ... _
    Copying subordinate records with a Add Query ...
    strSQL = "INSERT INTO TeamComposition ( TeamMember, MovementID ) " & _
        "SELECT TeamMember, " & lRecIDNew & " AS RecIID " & _
        "FROM TeamComposition " & _
        "WHERE (MovementID = " & lRecID & ")"
    CurrentDb.Execute strSQL 'исполняем
    
    Me!Form1.Requery
    'The data has been successfully copied! = Meesage:
    MsgBox "Данные успешно скопированы!", vbOKOnly + vbInformation, "Information"
 
cmdDuplicateRecord_Click_End:
    Exit Sub
 
cmdDuplicateRecord_Click_Err:
    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure cmdDuplicateRecord_Click.", vbCritical, "Произошла ошибка!"
    Err.Clear
    Resume cmdDuplicateRecord_Click_End
 End Sub
 

Minty

AWF VIP
Local time
Today, 03:08
Joined
Jul 26, 2013
Messages
10,371
You can open as many instances of a form as you like.
The difficulty comes when you want to know which one you are on, keeping track of that can become quite convoluted.

The thread here discusses it
 

accessonly11

Member
Local time
Today, 07:08
Joined
Aug 20, 2022
Messages
91
will these codes do as i want,

i need, let suppose one customer come for order, user is making its order, in while this order has to be hold for some minuts for some reasons, can we open another window (or windows) of same order sales form(with subform and all its functions) to make a new order for new customer
 

accessonly11

Member
Local time
Today, 07:08
Joined
Aug 20, 2022
Messages
91
i thinks using unbound controls and forms with some codes in vba, may be it is possible
 

ahmedjamalaboelez

Ahmed J. Aboelez
Local time
Yesterday, 19:08
Joined
Feb 25, 2015
Messages
79
will these codes do as i want,

i need, let suppose one customer come for order, user is making its order, in while this order has to be hold for some minuts for some reasons, can we open another window (or windows) of same order sales form(with subform and all its functions) to make a new order for new customer
This is easy Trick we call it in business parking , its need pending table between
 

CJ_London

Super Moderator
Staff member
Local time
Today, 03:08
Joined
Feb 19, 2013
Messages
16,635
its need pending table between
In Access, no, it doesn't, just needs a separate instance of the form. Every form is a class. If this is a regular occurrence then better to keep the original order form as a 'template' - can be hidden. As each new order comes along, make an instance of the template and then make the instance visible, perhaps hide the other instances. In that way you can have multiple instances open at the same time.

Or just save the incomplete order as per normal but with an 'incomplete' flag of some sort. User can then return to it when required, the flag would be used to prevent any onward processing.

instances are really only useful when you want to display 2 or more copies of the same form side by side. I use the mousemove event to drag a subform off the main form into an instance for example
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 10:08
Joined
May 7, 2009
Messages
19,246
here is a demo of multiple Order form.
 

Attachments

  • MultipleOrders.accdb
    664 KB · Views: 99

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 22:08
Joined
Feb 19, 2002
Messages
43,371
Having multiple forms open at one time leads to confusion. I recommend against it. However, If you choose to do it, at least ensure that only ONE of them can ever be updated. Otherwise, you'll end up with your user updating record 5594 instead of 4422 and having no way back.
 

Users who are viewing this thread

Top Bottom