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...
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.
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...
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.
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...
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...
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...
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...
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...
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.
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...
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...
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...
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...