Find Jobs
Hire Freelancers

Need an automatically reset counter

$30-35 USD

Em Andamento
Publicado há mais de 20 anos

$30-35 USD

Pago na entrega
Need a VBA code that will automatically generate a 5 digit number in the form of (month "-" and sequence) ie: 06-150 or 12-873. I need this number to automatically reset to 001 when the month changes. The database I am working with is Access 2002. I just need the VBA code and EXPLICIT instructions as to how to set up the table and the install the code. I am very new to VB so please dont take for granted I will know certain steps. This is a small part of a much larger project. So if the work is fast, fairly priced and well executed, we will have more projectys to discuss. Here is the code that I have worked on myself Option Compare Database Private Sub cmd1_Click() Dim LocalConnection As [login to view URL] Dim rJN As [login to view URL] Dim cMonth As Integer Dim cYear As Integer Dim vYear As Integer Dim vMonth As Integer Dim vNum As Integer Set LocalConnection = CurrentDb() Set rJN = [login to view URL]("TEST") [login to view URL] vYear = Val(Left$(rJN(0), 2)) vMonth = Val(Mid$(rJN(0), 3, 2)) vNum = Val(Right$(rJN(0), 3)) cYear = Year(Now) cMonth = Month(Now) If vMonth = cMonth Then rJN(0) = rJN(0) + 1 Else [login to view URL](0) = (cMonth) + (cYear) + ("001") End If [login to view URL] = rJN(0) End Sub There are problems with this code and it is not returning the result I need. The number generated in the table should be (month, year and sequence) ie 082003500 and the number visible needs to be 08-500. I haven't worked on that part yet because I am having too many problems with the number generating part. thanks ## Deliverables Code snippet and Very Cleear instructions as to how to set it up. Complete ownership and distribution copyrights to all work purchased. ## Platform VBA
ID do Projeto: 2973866

Sobre o projeto

3 propostas
Projeto remoto
Ativo há 21 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
Concedido a:
Avatar do Usuário
See private message.
$11 USD em 5 dias
5,0 (1276 avaliações)
7,5
7,5
3 freelancers estão ofertando em média $16 USD for esse trabalho
Avatar do Usuário
See private message.
$25,50 USD em 5 dias
4,7 (16 avaliações)
4,4
4,4
Avatar do Usuário
See private message.
$12,75 USD em 5 dias
0,0 (1 avaliação)
0,0
0,0

Sobre o cliente

Bandeira do(a) UNITED STATES
United States
1,4
5
Membro desde set. 24, 2003

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.