DMax using Listbox not working

Chuckieinoz

New member
Local time
Today, 23:28
Joined
Apr 1, 2020
Messages
9
Hi Everyone I have a problem that for the life of me i can not work out.
I am trying to use Dmax in a listbox to return Account number in a seperate text box my code returns no Errors but just is not working.
Attatched is a Text Db with Form and respective Table.
 

Attachments

do not add space between the "single quote" character:
Code:
    Me.txtGroupNumber = DMax("AccNumber", "tbl_ChartOfAccounts", "AccName= '" & Me.ListSelectPrimary & "'") + 1

you should also add a "descriptive text" about what this number is, like (in a Label):
Code:
Me.lblAccount.Caption = "Next Account Number for the Group: " & Me.listSelectPrimary
 
do not add space between the "single quote" character:
Code:
    Me.txtGroupNumber = DMax("AccNumber", "tbl_ChartOfAccounts", "AccName= '" & Me.ListSelectPrimary & "'") + 1

you should also add a "descriptive text" about what this number is, like (in a Label):
Code:
Me.lblAccount.Caption = "Next Account Number for the Group: " & Me.listSelectPrimary
Thanks mate worked great
 

Users who are viewing this thread

Back
Top Bottom