When the message box comes up that asks you if you want to debug, click yes. When the next message box tells you there is no user source, click OK. Click on Debug - Call Stack. The method that created the error should be highlighted. Double click on the highlighted error, and you the code...
I was able to get this to work with the following code:
DoCmd.GoToRecord acDataForm, "Registration", acGoTo, numin
The actual code I used is:
lngRecordNum = Forms.Item("Recruitment").CurrentRecord
Forms.Item("Recruitment").Requery
DoCmd.GoToRecord acDataForm...
Sorry for the lack of clearity. Here are two queries that are closer to what I'm truly looking for:
This query counts all the courses in the catalog:
SELECT COUNT(*)
FROM CATALOG;
This query counts the distinct number of courses each student has taken, and groups it by student id:
SELECT...
I need a query that will display the students who have enrolled in all the courses. I am working with the following tables:
STUDENTS(SID,FNAME,LNAME)
CATALOG(CNO,CTITLE)
COURSES(TERM,LINENO,CNO)
ENROLLS(SID,TERM,LINENO)
I can display the number of courses each student has enrolled in by using...
I found one answer to my own question. Is this the best way to do it?
SELECT *
FROM (SELECT CUSTOMERS.CNAME, COUNT(DISTINCT ORDERS.ONO)
FROM CUSTOMERS, ORDERS
WHERE CUSTOMERS.CNO = ORDERS.CNO
GROUP BY CUSTOMERS.CNAME
ORDER BY COUNT(DISTINCT ORDERS.ONO) DESC)
WHERE...
I'm trying to get the names of customers who have placed the 5 highest orders. I'm able to run one query to find the highest order, and another query to find the number of orders placed by each customer. Is there a way to combine these two queries to obtain the desired results?
Here are the...
Using the proposed formula resulted in only #N/A and FALSE values. This is how I tested it:
=IF(VLOOKUP(B10,'ExcelFile.xls!$A:$D,4,FALSE)="#N/A",0)
However, I was able to get the following formula to provide the desired results...
Here it is... This code will remove a module from a VBA project:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Function KillMacros()
Dim intCount As Integer
Dim intComponentNum As Integer
intCount = 1
intComponentNum = ThisWorkbook.VBProject.VBComponents.Count
Do While...
This functionality would be quite useful to me also. I tried implementing the code, but I received the following error:
Run-time error '424':
Object required
I am still playing with the code to try and figure out how to fix the error, but if there are any more suggestions, please post...
Here's something that seems to work. It's pretty crude coding, but at least it seems to get the job done.
Dim intRow As Integer
Dim intCol As Integer
Dim sngGetValue As Single
Dim strCellAddress As String
Selection.Offset(intRow, intCol + 7).Value = "=CELL(" &...
Goska:
I tried your proposed solution, but ended up with the same error. Here is the code I was using:
Dim sngGetValue As Single
sngGetValue = Selection.Offset(intRow + 5, CStr(intCol + 64)).Value
If (IsNA(sngGetValue)) Then
sngGetValue = 0
End If
Any other ideas?
Is there a reference that needs to be added to use the IsNA function? When I tried to use it, I received the following error:
Compile error:
Sub or Function not defined
Amazingly enough, I believe that I've found a solution to my own problem. For those interested, the code I'm now using is as follows:
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Cells.Replace...
I'm working with VBA to replace #N/A values with 0s in an Excel spreadsheet.
The #N/A values in my spreadsheet are the result of the VLOOKUP function.
The problem I'm encountering is that I receive an error every time I try to check for a #N/A value. Currently, I'm trying to detect these...
I'm using VBA to delete a worksheet in Excel. Each time I delete a worksheet, Excel produces a message box with the following warning:
The selected sheet(s) will be permanently deleted.
To delete the selected sheets, click OK.
To cancel the deletion, click Cancel.
Is there a way to...
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.