Field with 1 to 50 entires..how to design

Again that works, thank you.

Couple small questions, is there a way to get the "*" to show the input mask rather than an underline?

And although I have State/Research Accounts required on my table for both my main and subform table, I am still able to save without my subform field being filled in. How would I fix this because this State/Research Account field needs to be filled in everytime?
 
The third argument determines what character is used.

On my copy the account is not set to required, but I assume you changed that. It is also set to allow zero length strings, and I would change that to No. With those settings, you should not get records without that value.
 
Ok, third argument? Something I need to add?

And Yes, I changed State account to required and also changed no to allow zero lengths. But I am still able to close or add another record, without filling in an account. I updated an earlier database with a subform and the same thing happens...?
 
Have you looked at help on input masks? I don't know what yours looks like, but my examples above have 3 arguments, separated by semi-colons.

Are you saying you can add a user without adding a state, or that you can create a state record without the account filled in?
 
I go to enter a new record on the main form, I fill in all of the required fields, and I'm able to save the record without getting an error null message for my State Account subform field. (With me leaving that field blank)
 
Well, you have to be able to create the main record before creating the sub record (otherwise there's no UserID to relate them), so this is the type of thing you'll have to enforce yourself.

I actually have a similar situation, where drivers can take out more than one car during the day, but must take at least one. Since the data entry people are pretty good about doing that, I didn't bother trying to enforce it during data entry. I created a query that will find instances that were missed, so they can find them after the fact.

That works well for us. If you decide you need to enforce it during data entry, you could automatically create one sub record when the main record is saved. Use an input box or something to get the first number, create a sub record and requery the subform.
 
If you decide you need to enforce it during data entry, you could automatically create one sub record when the main record is saved. Use an input box or something to get the first number, create a sub record and requery the subform.

What lol? Put the Input box on the subform??? And currently I don't have a query at all in this DB, I would have to make one and have the subform point to the query rather the additional table i made for the subform?
 
I'm going to repost my database for this problem, the other one your helping me with I think you will be able to talk me through, but I gotta see what you mean since I'm not use to all Access terminology.

Thanks as always.
 

Attachments

This type of thing:

Code:
Private Sub Form_AfterInsert()
  Dim lngAccount         As Long

  lngAccount = InputBox("Enter account")
  CurrentDb.Execute "INSERT INTO tblState(UserNameID, StateAccounts) " _
                  & "VALUES(" & Me.UserNameID & ", '" & lngAccount & "')"
  Me.frmStatesubform.Form.Requery
End Sub
 

Users who are viewing this thread

Back
Top Bottom