Yes SWi, I agree with LameID, i'm amazed the recordset & count property EVER worked. All the same. excuse the obvious but "Job File" & "JOB ITEMS Query" forms, must be open. (assuming parent & child form) Is the control holding this expression, located on either form/subform?
All the same, i...
Or,
depending on what dictates the value of MyVar,
you could use the source as an argument, to your function.
On Click Event of each cmdButton..
If TextBox on current form
"= ReturnWard([txtMyVar])"
If "random value"
"= ReturnWard(6)"
etc...
As Remou said, otherwise, convert the "short time" variable,
to a string...
Dim varStartTime As Date, varEndTime As Date
Dim strStartTime as string, strEndTime as string
varStartTime = "10:00"
varEndTime = "14:00"
strStartTime = Format(varStartTime, "short time")
strEndTime =...
Actually, small oversight (in case you decide to use this)...
Do Until rec.EOF
For x = 1 To 2
SQL = "INSERT INTO NewTAble(SupplierID, PackagingType, Value)" & _
"VALUES(" & rec(0) & ",'" & rec(x).Name & _
"','" & rec(x) & "')"
conn.Execute SQL,,adExecuteNoRecords...
Very quickly, of the top of my head...
Rec As New ADODB.Recordset, SQL AS String, x as integer
conn as New ADODB.Connection
Set Conn = CurrentProject.Connection
rec.open "tblPackage", conn, adOpenForwardOnly, adReadOnly
Do Until rec.EOF
For x = 1 To 2
SQL = "INSERT INTO...
As PHV said, that would be the easiest but, just for the record,
you could create a form from scratch, change the
"recordsource" property to any table or query you like,
from there, the "Fields" icon from your menu bar,
will offer all the available fields (dictated by your recordsource)...
kopy, try to speak in more general terms.
What's a "drawing" file?
...a file in same/another directory?
What, where & how, do we find the "Current part Number"?
..from a main/sub form, with the focus?
VBA has many file search and manipulation functions.
And print methods & actions.
Type...
You can't enter Numeric values? ...can you enter text values?
Check all properties...,
Subform, enabled/locked.
Check the recordsource, any calculated fields.
Any of the controls, enabled/locked?
Ragah, Ace & I are probably unsure where & what recordsource
you're updating (parent, child, control?).
So, if main form, Me.recordsource.Requery
or Me.refresh or Me.Recalc maybe Me.Repaint
If subform Me.sfrmName.Form.Requery
it appears you tried to requery a control.
I think only listboxes...
Sellert, otside of Ace's code, you consider either
using "Totals/Grouping" query(toggling the Sum icon
on the menu bar, in the query pane), or just downright
use the grouping properties on the report,
from design view (preferred!).
well, I finally got off my lazy b*** and tried it.
strSQL = "UPDATE Requests" & _
" SET Requests.A=Year([B]) & '_' & [RequestID]" & _
& " WHERE ((Requests.[A] Is Null) AND " & _
(Requests.[B] Is Not Null));"
So yes Aceman, I believe you're correct on both...
Kaned, are you sure Reservations AND Rooms are BOTH continuous?
Access does not allow a contiuous form within a continuous
form?
So, my point is, if Reservations is singular,
you can use an unbound calculated field, with a controlsource
like
=DMax("txtDate","tblRooms","ResID =" & [ResID])
PS...
Good point Ace but, I'm really getting tossed on the
syntax, eg. mine's way out of whack!
But, are you sure about yours? Ragah said A was Text.
I'm assuming we need qualifiers, and since most
VBA funcions are legal in SQL statements, no need for concatenation, thus...
strSQL = "UPDATE...
Sorry CopperWire, I forgot to add...
Err_Command84_Click:
If Err = 3022 Then '(duplicate Key)
MsgBox "This record already exists", vbOKOnly, "Record NOT Saved"
Resume Next 'or whatever you want
Else
MsgBox Err & vbcrlf & Error$,,"Error"...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.