Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    Join Date
    Mar 2023
    Posts
    15
    It finally worked. Thx to everyone for the help, direction and inspiration to understand how VBA works. Now I know a little bit more. This ended up being my solution:



    Private Sub OpretSerieNrKnap_Click()

    If [Forms]![OpretSerieNr]![Basic500Amount] > 0 Then
    Dim count As Integer
    For count = 1 To [Forms]![OpretSerieNr]![Basic500Amount]
    Dim SQLbasic500 As String
    SQLbasic500 = " INSERT INTO SerieNr_Label ( Varenavn ) " & _
    "SELECT 'Basic500'"


    DoCmd.RunSQL SQLbasic500
    Next count


    End If

  2. #17
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    Looking at your form, my first concern is what happens when you add another product?. Hard coding it leaves you few options.

    Here's an example db for you to pick apart for ideas.
    Attached Files Attached Files
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 01-24-2022, 08:46 AM
  2. Replies: 21
    Last Post: 01-10-2019, 03:21 PM
  3. Replies: 3
    Last Post: 06-08-2017, 08:03 PM
  4. Replies: 25
    Last Post: 06-08-2015, 04:25 PM
  5. Replies: 2
    Last Post: 10-25-2010, 10:45 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums