I think this is what you are trying to do:
Dim sNote as String
sNote = Now() & "-" & Environ("username") & ": "
IF IsNull(Me.txtAppendField)=TRUE or Me.txtAppendField = "" THEN
Msgbox "Please Enter A Note",vbInformation
ELSE
sNote = sNote & Me.txtAppendField
sNote = sNote &...
Try something like this:
Dim sSQL as string
Dim rs as RecordSet
sSQL = "SELECT * FROM [Table] WHERE [Field]=" & YourValue
Set rs = CurrentDB.OpenRecordset(sSQL)
IF rs.RecordCount>0 THEN
MsgBox "Record Already Exists", vbInformation
ELSE
CurrentDB.Execute YourQuery
Msgbox...
You can use system stored procedures in SQL Server to get the info you are looking for:
sp_HelpDB - lists all databases on the server
sp_Help - lists all objects in a database (including tables)
sp_Help [table name] - returns info about the table including fields
Hope this helps
We have been performing a performance audit on our SQL Server and the following came back as a high response query:
SELECT @BlobEater = CheckIndex(FactKeyA + FactKeyB + Facts)
FROM (SELECT TOP 100 PERCENT FactKeyA, FactKeyB, Facts
FROM { IRowset 0x18A7F13E }
ORDER BY...
Try something like this:
Public g_dDate As Date
then
g_dDate = format$(Me.txtTransDate, "short date")
then
Dim m_dDate As Date
m_dDate = g_dDate
Me.txtTransDate = m_dDate
If you don't want to add a bound field, you could execute an SQL update. You would need to know the unique ID of the record that you want to update.
dim sSQL as String
sSQL = "UPDATE [YourTableName] SET [Tax]=" & Me.Tax.Value & " WHERE [YourIDNumber]=" & [IDNumber from...
Sisan:
Use a variant data type and set its value based on what has been entered by the user.
Dim vDate As Variant
If IsDate(Me.txtInputDate) = True Then
vDate = Me.txtInputDate
Else
vDate = Null
End If
rsTable!InputDate = vDate
Bill:
Here is an example using two check boxes named chk1 and chk2. When the user updates chk1 the code will either enable or disable chk2 depending on whether the value for chk1 is true or false. Hope this helps.
Private Sub chk1_AfterUpdate()
If Me.chk1 = vbTrue Then
Me.chk2.Enabled...
Brian:
The easiest way to build this in an Access query is to add your table and fields in design view. Then select the Totals button on the query toolbar (looks like a Sigma). This adds a row titled "Total". By default it will be "group by". Change it to "Min"...
Gus:
I think this is what you are looking for. Assuming the check number is always a number.
Dim lCheckNumber As Long
Dim vPaymentAmount As Variant
Dim sLookupString As String
If IsNull(Me.txtVoidCheckNo) = False Then
lCheckNumber = Me.txtVoidCheckNo
sLookupString =...
FontanaS:
I have found that using stored procedures noticeably increases the performance of my VB apps. I think the best way to determine the performance difference would be to write two procedures that perform the same task. One would use your normal ADO recordsets and the other would use...
Kerry:
You won't be able to directly reference the control on the subform from the parent form.
Try changing the way you reference the control on the subform from:
[Forms]![sfrmRequestDetails]![cboDivision]
to:
[Forms]![Name of Parent Form]![Name of Subform Control on Parent...
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.