Select Statment in VBA

That's looking closer (does it work?). You have some values that look like they'll need delimiters, like the ' you have around the AccountName value. Text values need that, and date/time values need #.
 
I am completely lost, can you show me an example?
 
So the date fields need both & and #?
 
The & is just a concatenation operator. The # tells Access the data type of the field is date/time. It would look like:

...and AcceptDate = #" & [Forms]![Request lookup and update]![txtDateRequested] & "# and Assignedto ...
 
I am trying to assign value to a check box from a table.

Set rstemp = db.OpenRecordset("Select * from History_Table where AccountName Like '" & [Forms]![update]![ctlName] & "*' and Status = 'Open'")
With rstemp
.MoveFirst
Me.ctlName = !AccountName
Me.ChkDe = !fine
Me.ChkMe = !Meter
End With

I am having troubles with the highlighted. I get an error message -

"You can't assign a value to this object"
the fields on the table (Fine, Meter) are Yes/NO fields, what Am I doing wrong? please help
 
Double check the name of the checkboxes (like make sure you didn't get the label names by mistake). Also make sure the control source of the checkbox is either blank or has a field name, not an expression. If a field name, make sure the field isn't read-only.
 
I have a text box named "Update"

I am trying to
  • auto populate atextbox with current date
  • Cursor to stay at the end of date & be ready for user input
  • user to key-in text at the end of date
I used the on-click event to add current date, however when the user wants to key-in input, the date disappears.

How can I get the date to stay there & yet allow the user to enter text?
 
Look at SelStart and SelLength in VBA help.
 
I have a text box for capturing progress update, I want when this text box gets focus to add current date & move insertion point at the end of the date.

the below code places the insertion point at the end of text but I am not sure how to add the date automatically, any ideas?

Private Sub Progressupdate_GotFocus()
Progressupdate.SelStart = Progressupdate.SelLength
End Sub
 
I thought you already had that part.

Me.Whatever = Date()
 
I want if chkdefine is checked, I want to check if Definedate is null, if Definedate is not null, I do not want it to change but if it is null, i want it to update to current date. I have the below code but it does not seem to be working, please help


If ChkDefine.Value = True And tblpool![Definedate] Is Not Null Then
tblpool![Definedate] = Date
End If
 

Users who are viewing this thread

Back
Top Bottom