Search results

  1. P

    How to update identical records on table?

    Thanks that's brilliant. Just needed do a couple of minor changes to get it to do exactly what I want. Private Sub Command8_Click() Dim Total As Integer Dim Num As String Dim Prefix As String Dim BC As String Dim ZC As String Dim zeros As String Dim lngNumberOfCharacters As Long Dim...
  2. P

    How to update identical records on table?

    I am getting runtime error 3027 Cant update, Database or object is read only. From looking up the error code it appears that this is due to the subform being based on a query rather than a table. So the Recordsetclone is read only. The table it self is called DueInTable.
  3. P

    How to update identical records on table?

    Hi I have a Query and a form which shows records on a table where a Table field matches a field on a subform(ATRNumber). The records outputted by the query are mainly identical records. I want to be able to add a unique string(generated by a DO Loop based on a count of records with...
  4. P

    How to keep Leading Zero's ?

    Decided to use yours. I created a function for all possible string lengths. Then set a variable to a count of the length of the string in the textbox. Then used that number to call the appropriate function.
  5. P

    How to keep Leading Zero's ?

    The problem was that the format changed in length. But I have solved it. I used Public Function CountStrOcc(strFind As String) As Long CountStrOcc = Len([BarTxt]) - Len(CStr(Val([BarTxt]))) End Function to count the leading zeros and then just used an IF ElseIF...
  6. P

    How to keep Leading Zero's ?

    Hi Firstly sorry if this is not the right section for this. I have a String variable that gets it's value from a textbox. This value can be anywhere from 0000001 to 9999999 Or 000001 to 999999 Or 00001 to 99999 I need to be able to add one to the value on each iteration of a...
  7. P

    problem inserting multiple records into Table

    Yes that did the trick. Time for a celebratory beer now :)
  8. P

    problem inserting multiple records into Table

    I seem to have got very close to what I want by making NumberTxt an unbound text box. Now the right amount of records are being saved. But to view the results after clicking the save Items button in the subform I have to copy the text in the textbox NumberTxt and then click(not paste) in the...
  9. P

    problem inserting multiple records into Table

    No I need to be able to filter records based on the ATRNumber. Plus if you add a second lot of items without closing the form first an extra Item is saved It may help if I say what the process is. My company will receive a notification from a customer that they are sending in x amount of...
  10. P

    problem inserting multiple records into Table

    Now it's adding one to many. What seems to be happening is that because of the On lost Focus event of the textbox NumberTxt. When NumberTxt loses focus when you click the save Items button. it automatically saves the record and then carries on doing the save. If I remove the On Lost focus event...
  11. P

    problem inserting multiple records into Table

    That partially fixes the loop. when you first click the Save button only one record gets saved. But if you fill the form out again all records get saved. I have attached a cut down version of my database so you can see exactly what is going on.
  12. P

    problem inserting multiple records into Table

    Hi I have a Form called FrmAddDueIn which is for adding multiple records into the Table DueInTable. Im using a textbox on the form called AmountTxt to specify the number of records to add when the Button SaveItemsBtn is clicked. I am passing all values to variables before the Loop which...
  13. P

    unwanted line in datasheet view

    I have used the >0 condition on the count field of the query. This gets rid of the zero value line. I haven't a clue why this was happening in the first place though. The Table that the query looks at does not have any zero values. Below is the SQL of the query. Maybe you can spot what is...
  14. P

    unwanted line in datasheet view

    Hi I have an aggregate query that I'm using to count Items on an order based on part number as well as giving total items on the order. This works but the first line in datasheet view is an empty line other than the order number and a count of 0. Is there a way to stop this line from...
  15. P

    Problem updating subform via onchange of textbox

    I have found it. It seems to be because the combo box used to select customers was called customer and it seems the query when ran from the main form was using that control instead of the table field customer. Renaming the control to CustomerCombo sorted it. Luckily there wasn't much of the VBA...
  16. P

    Problem updating subform via onchange of textbox

    Got a weird problem with my form FrmAddDueIn. I want to create a OnChange event on the textbox NumberTxt that updates the subform ATRRecordQuerySubform. My problem is that the form for an unknown reason will update the subform based on NumberTxt value and the value of the combobox...
  17. P

    Query to count items in a table with same part number

    nevermind I figured it out :)
  18. P

    Query to count items in a table with same part number

    That gets me a count of the individual part numbers. But I also need a total items as well. So say item1 10 item2 5 item 3 total items 18
  19. P

    Query to count items in a table with same part number

    hmmm for some reason this website is deleting the spaces in my example but it should show the model description under the model heading, the part number under the part number heading and the quantity of each under the quantity heading
  20. P

    Query to count items in a table with same part number

    Hi I have a Table called DueInTable. This holds a list of items on a order that are due in. Each order has a unique identifier called ATRNumber. What I want to do is create a query that counts the number of Items on the order with the same part number() on the selected order and the output of...
Top Bottom